folder action script - how to?
I'd like to add a particular folder action to a given folder. This folder action script should label every ".pdf" inside the folder with a particular color, which i have choosed before. Example: if i drag a "pdf" into that particular folder, that pdf should change its label. Or, else, if i save a .doc document as a ".pdf" into the same folder (that one with folder action) the pdf should change its label. So either of both ways should be possible. Drag a new "pdf" into that particular folder OR save as pdf into that folder. How to?
best
best
Comments
property extension_list : {"pdf", "PDF"}
property color_label_index : 1
on adding folder items to this_folder after receiving these_items
try
repeat with i from 1 to number of items in these_items
set this_item to item i of these_items
set the item_info to the info for this_item
if (name extension of the item_info) is in the extension_list then
tell application "Finder"
set label index of this_item to color_label_index
end tell
end if
end repeat
on error
display dialog "Error"
end try
end adding folder items to
Paste it in Script Editor, save it in ~/Library/Scripts/Folder Action Scripts/, then attach it to the desired folder. Edit the number on line 2 to get the desired label color. Hope this helps.
Thanks so much.
Costique you are the best.
Originally posted by Vox Barbara
wow, just tried it out, ... i'am just overwhelmed, it is working as i wished it should work. You made my life easier as it never was before.
Good.
Thanks so much.
Costique you are the best.
Oh, it was really easy. Anyway, thank you for appreciation.