I’m pasting copyright info into the comments field of the info boxes on hundreds of files (mostly psd, tif, and jpg) on Mac OsX 10.2.6 . I basically just type the info into one info box’s comments field, then copy it and open the other info boxes one at a time (using the “Command+I” key shortcut), then paste the info into the comments field (using “Command+V” shortcut) of the info box for each document in a given folder. Then close the info window. As you can imagine this is very tedious. I know there must be a way to automate such a simple task on Mac OsX, although I’ve looked through numerous Mac OsX handbooks and can’t find any helpful advice.
I’ve tried opening applescript, pressing record and performing the task described above, but the applescript recorder doesn’t record the actions performed.
Does anyone out there know how to do this (automate this task) correctly on Mac OSX?
Also whenever I change and save a file, my notes in the comments field in the info box for the file disappear and I have to re-enter it. On the old Mac Os, 8 through 9 anyway, the comments in the info field stayed there even if I changed and saved the file, or even if I changed and did a “save as”.
Is there a way around this MacOsX annoyance of deleting the info comments when making changes to and resaving a file?
Now is there any way to apply the action in the script to all subfolders of a given folder? or do you just have to make a new script for each subfolder by name?
You can use some interaction to assign the variables for both the comment and the source folder. As to the subfolders, there are lots of ways to do this (take a look on Code Exchange, ScriptBuilders, or do a search of the board). The routine I include below uses the Finder so it isn’t as fast as some of the other methods but it will (hopefully) make some sense to you (it uses recursion to get all the folder names):
You could also add an open handler and save this as an application to allow you to assign the parent folder via drag & drop (do a little searching as to how to do this if you’re stuck).
I am a bit new to scripting but you could try this:
tell application “Finder”
repeat with i from 1 to (count of all_folders)
if type of file i is “8BIM” then
set comment of every file of (item i of all_folders) to commentText
end if
end repeat
end tell
I think that is the correct format. What this does is check if the file in question if PhotoShop.
Hopefully someone with a bit more knowledge will check my suggestion.
I checked all the files in the folder and they do have the proper .jpg .tif and .psd file extensions.
Note: “Western Digital HD 2:AddComments:” is the path to the folder on my hard drive.
The code works before changing the line as suggested, but puts the comment (copyright info) in the comments field of ALL files in the folders, not just the tif, jpg, and psd files, which still is of great help and will save me hours of time each week. If anyone has any idea why I’m getting that error message, though, please let me know.