Alpha Video Training
Results 1 to 4 of 4

Thread: File to Clipboard for pasting file into other folder

  1. #1
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,184

    Default File to Clipboard for pasting file into other folder

    I'm sure this has been asked before but I can't find it. Using Windows File Explorer, after navigating to the file you seek, you can select the file, right mouse click, and copy the file to the clipboard. This can be done with ui_get_file(). However, I am trying to reduce the user having to execute navigating and searching for files. I know of neither a way to get Alpha to show a single specific file in a folder having many files, nor of xbasic code to get a file to the clipboard making available the file to be pasted into a folder location of the users choice.

    I am somewhat left with having to have a temp folder used to copy specific files into, have ui_get_file() to open that temp folder which will have few files for the user to have to select from, have the user perform right mouse click and copy, and then delete the temp folder file selected. Not a bad option, but I though maybe there is something more direct.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  2. #2
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,318

    Default Re: File to Clipboard for pasting file into other folder

    Sorry Mike, you've lost me somewhere.
    Do you know the file name before the search?
    Can you construct thefile name from data in Alpha?
    Are the file names constructed to relate to a record in AS?

    I had this problem with images. Needed to associate an image with a specific item.
    The item had a PK of, say 1234567+trailer+09 composed of vehicle, vehicle type,vehiclectype number
    The image had a filename of 1234567trailer09.jpg, in the Images folder.
    The file loookup was specific and went straight to the image file.

    Why are you wanting to copy the file location?
    Could you use a Hyperlink field?
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  3. #3
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,184

    Default Re: File to Clipboard for pasting file into other folder

    Hi Ted,
    Yes the complete file path and file name is known. Example:
    ROOT FOLDER: C:\Art\Assets\Assets_repository\
    FILE: C:\Art\Assets\Assets_repository\AST.00013_Coors Light Giant Kickoff.AI

    With this, I would like foremost to be able to have this file copied directly to the the Clipboard to be able to paste the file the desktop. I see no method to do this directly with xbasic.
    Unable to get the file directly put to the Clipboard, I believe I have to open the file navigator and right mouse click on the file to get the file onto the Clipboard.
    I can use ui_get_file() to open the folder where the file is located, but the folder has 1000 files and navigating to the exact file is cumbersome. I don't see a way to get to the exact file using ui_get_file to have only that exact file presented to right click and copy it to the Clipboard. So

    1- Is there a method to directly get the file to the Clipboard without having to use ui_get file()....
    2. Is there a syntax/method to get ui_get_file() to present only the exact file and not the contents of all the files in the root folder and having to navigate to the file.

    And no, using file.copy() is not an option, because I am using the scenario of pasting to the desktop as an example. Where the file is to be pasted is dynamic, not predetermied, and will be the choice of the user at the moment.
    Last edited by Mike Wilson; 08-14-2019 at 10:48 PM.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  4. #4
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,318

    Default Re: File to Clipboard for pasting file into other folder

    I am probably being a bit thick here, but when you say "the file", what do you need to do with it?
    Do you want the whole file to go into a Memo Field, to create a link so that if the user can click and display the file content or what?
    Copying it would mean 2 versions of the file, so is that what you are after?

    EDIT
    What about Clipboard.Set_Data() ?
    Then, you could test for the presence of the file using File.Exists()

    So, a message if there is no file to find, or a Clipboard path with the file created in it as you have the construction already?
    Last edited by Ted Giles; 08-15-2019 at 04:26 AM.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

Similar Threads

  1. Pasting from windows Clipboard
    By alexmuir in forum Windows Desktop Applications
    Replies: 8
    Last Post: 07-21-2016, 11:27 AM
  2. File upload - PDF file not being uploaded to designated folder
    By clankford in forum Mobile & Browser Applications
    Replies: 5
    Last Post: 11-19-2015, 04:50 PM
  3. image file from clipboard data
    By john michaels in forum Alpha Five Version 11 - Desktop Applications
    Replies: 5
    Last Post: 11-24-2013, 04:08 PM
  4. Getting the folder location on file upload and file download javascript
    By acceptthis in forum Application Server Version 11 - Web/Browser Applications
    Replies: 3
    Last Post: 03-09-2013, 06:00 PM
  5. move a file from folder x to folder y
    By Ken Tjia in forum Alpha Five Version 9 - Desktop Applications
    Replies: 7
    Last Post: 11-26-2009, 01:38 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •