March 12, 200619 yr Hi all, I've been trying all afternoon to get this to work but I'm finally ready to throw in the towel and ask for help on this one. Here's the scenario: I need to insert files into a container in FM, but they need to have their names changed before I insert them. I have all my fields and variables holding the correct info but I can't get the AppleScript to work, This is what I've got so far.. "Tell application " & Quote ( "Finder" ) & ¶ & "set name of file " & $filePath & " to " & $newFileName & ¶ & "end tell" $filePath is called out with colons, like "Mac:users:me:NameOfFile.pdf" $newFileName is called out like "ChangedNameOfFile.pdf" (all sans quotations) I'm certain it's my syntax in the AppleScript but I can't figure out where the problem lies. Thanks in advance for any help offered! Edited March 12, 200619 yr by Guest
March 12, 200619 yr A couple things. First, you're using the "local to this script only" syntax for your variables. Apparently they aren't available to the calculation, as it won't work. Use "$$" instead. You also need to somehow get quote marks around your filepath and your file name, as they are text. This works: "tell application " & Quote ( "Finder" ) & ¶ & "set name of file " & Quote ($$filePath) & " to " & Quote ($$newFileName) & ¶ & "end tell"
Create an account or sign in to comment