I am trying to do something that I’m sure is incredibly simple, but I can’t figure it out. The goal is to open a file-picker, choose a file, then have Applescript duplicate that file to a new folder and rename the new file.
What I have so far is:
set TheFile to (choose file with prompt "Select Photo...") -- set ThePath to POSIX file ("/Users/New/Folder/Path/Photos/") set NewName to "New Photo Name.jpg" -- set OldName to name of TheFile as string tell application "Finder" duplicate TheFile to ThePath with replacing set name of alias ((ThePath & OldName) as text) to NewName end tell
But I’m getting an error saying can’t make alias into string… I’m sure I am confused by variable types.
Model: MacBook Pro w/ Retina Display
Browser: Safari 537.36
Operating System: Mac OS X (10.8)