Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A similar technique' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A similar technique
Authored by: mr. applescript on Jul 03, '02 12:52:35PM

Those new to Mac OS X might not realize that the shell is not the only way to automate the computer. Try using AppleScript. For example, here's the script for moving all the JPEG images in an entire directory to another folder. The variables (this_folder and target_folder) contain refs to the cooresponding directories.

-- Sal

tell application "Finder"
move (every file of the entire contents of this_folder whose name extension is "jpg") to the target_folder
end tell



[ Reply to This | # ]
A similar technique
Authored by: kerim on Jul 03, '02 07:29:23PM

Does this applescript solution work recursively? The issue was that iPhoto stores its photos in many many subfolders. If everything were in the same folder one could simply drag and drop the whole folder. I'm sure this is possible in Applescript, but I found that the shell sped things up considerably. Just think about all the spinning color wheels you get when you try to select a lot of items in the finder and do something with them! All those Aqua tricks (transparnet dragging) really don't scale very well when you are doing operations on thousands of files. It would be interesting to compare the speed using Applescript and using the shell ...



[ Reply to This | # ]