I have a script I got recently from someone on the Mac OsX Forum which I’m using to put copyright information in the comments field of all jpeg, tiff, and photoshop files in various folders and subfolders.
The script works great in MacOsX applescript but when I paste the script into the regular Mac OS 9 script editor I get one error.
The only problem is that when I do a check (or try to run the script in Mac OS 9) I get a message that indicates it’s having trouble with the term “name extension” in the line that reads, “set the_files to (every file of (item i of all_folders) whose name extension is in {“jpg”, “psd”, “tif”})”
The exact error message is “expected “,” but found identifier.” and the script checker highlights the word “extension”
Apparently the term is not used in Mac OS9 (That’s my best guess anyway).
If anyone who does Mac OS classic scripting knows why I’m having trouble with this line in Mac OS9 and not in OsX, and what I should change to make it work, I’d really appreciate hearing from you.
Yes, ‘name extension’ doesn’t appear in OS 9. Try changing whose name extension is in {“jpg”, “psd”, “tif”} to whose name ends with “.jpg” or name ends with “.psd” or name ends with “.tif”.
Nigel has it correct !
To help a little further I have modified your script to use a “subroutine” to get the 4 letter extension for each File and return it to the main portion of the script.
Actually, to simplify the script and get it working in OS 9 (and X for that matter–you could have originally stated that you needed it for both and I would have provided a cross platform solution, not an OS X-only one ), try this: