I could use some help from the experts.I have searched the posts but can’t seem to find an answer. I need to rename a file inside a folder with data copied to the clipboard from file maker pro.
I have the 1st part but can’t seem to get the paste from the clipboard to work.
tell application “Finder”
activate
set name of document file “untitled.tab” of folder “Telecine” of folder “Desktop” of folder “ian” of folder “Users” of startup disk -----what goes here to paste from clip board???
In addition to jj’s suggestion, I have to ask why you’re using the clipboard at all.
There’s no need to use the clipboard to move data from one application to another in AppleScript, and there are various reasons to NOT use the clipboard (not least of which is you don’t know if the user has something on the clipboard they want to keep).
Instead, use AppleScript objects. It’s been a while since I used Filemaker and AppleSript, but something like this would be better:
tell application "Filemaker Pro"
set newFilename to cell "filename" of current record -- I think this gets you the cell contents, but adjust as necessary
end tell
tell application "Finder"
set name of file "blah" of folder "blahblah" of disk "blahblahblah" to newFilename
end tell
In this way you don’t need to use the clipboard, you don’t overwrite anything the user thought was on the clipboard and you’re less prone to errors.