|
|
try this
I tried to write something like this but couldn't get it to work.
try this
I just tested all of the modifications listed above and here is a script that works fine: on adding folder items to this_folder after receiving added_items
tell application "Finder"
set homeFolder to (container of (path to desktop folder) as string)
set folderLocation to homeFolder & "Pictures:unfiled:"
repeat with aFile in added_items
if the name extension of aFile is in ¬
{"jpg", "gif", "png", "pict", "tiff", "gif", "psd", "bmp"} then
tell application "Finder"
try
move aFile to folder folderLocation
on error err
display dialog err
end try
end tell
end if
end repeat
display dialog ¬
"Image files have been moved to the Unfiled" & return & ¬
"folder in your Pictures folder."
end tell
end adding folder items to
If this doesn't work for you then make sure that you have run the "Enable Folder Actions" script and have successfully attached a folder action to the folder you want this script to run from. For a good reference on how to get it all to work see Apple's web page on Folder Actions.
try this
I moved the dialoge box telling me that image files had been moved because it was saying it no matter what I added..
try this
Heh, whups. I thought you meant that you couldn't get my modifications to work. I see now that you were just saying that you had problems with writing something similar to what I used. if the name of aFile contains {".jpg"} then
and this one: if the name extension of aFile is in {"jpg", "gif", "png"} then
are the keywords contains and is in. if the name of aFile contains {".jpg", ".gif", ".png"} then
The only thing that would match would be a file named "myfile.jpg.gif.png", or any file with all of those somewhere in it. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.05 seconds |
|