Change Filename of Selection to "Import.xls" in Applescript
Hi, I'm way back in Tiger, but I am trying to change the name of a file in a folder (which may be whatever name it is) to a known name. Ultimately, I'm just trying to import a known file to filemaker and need the name to be a known name. This is what i Have thus far, but I'm just not having success. This goes to the folder window 2 and selects the first file...no problem, but from there I can't seem to get it to change the name to "import.xls". Only excel files will be present in this folder, so I'm not worried about that.
The other thing I would like to accomplish is if there is no file in that folder than skip over everything and do nothing.
Thanks for your help!!!
tell application "Finder"
activate
set target of Finder window 2 to folder "Orders_to_Enter" of folder "Documents" of folder "MINIJOHN"of folder "Users" of startup disk
select first file of Finder window 2
try
set the name of the selection to "IMPORT.xls"
end try
end tell
tell
Mac mini, Mac OS X (10.6.8), Applescript