Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

lennyla9

macrumors newbie
Original poster
Feb 18, 2007
4
0
I'd like to write a folder action to automatically apply a colour label when a file is opened.

I've been having a look at how todo this but I'm new when it comes to folder actions, AppleScript and automator.

I'd originally thought the best way todo to was to simply apply the label when the last date opened was not null. Unfortunately all of the files report the date they were copied to their folder as their last opened date, even though I have not opened them!

Could someone give me a hint as to how I might achieve this?
 

MongoTheGeek

macrumors 68040
I'd like to write a folder action to automatically apply a colour label when a file is opened.

I've been having a look at how todo this but I'm new when it comes to folder actions, AppleScript and automator.

I'd originally thought the best way todo to was to simply apply the label when the last date opened was not null. Unfortunately all of the files report the date they were copied to their folder as their last opened date, even though I have not opened them!

Could someone give me a hint as to how I might achieve this?

on adding folder items to aFolder after receiving itemlist
repeat with anitem in itemlist
tell application "Finder" to set label index of anitem to 2
end repeat
end adding folder items to

save that script in the folder action scripts folder and then attach it to the folder.
 

lennyla9

macrumors newbie
Original poster
Feb 18, 2007
4
0
Thanks for your help. Unfortunately the script doesn't work.

I've saved it in the 'Library\Scripts\Folder Action Scripts' and attached it to the relevant folder.

Nothing happens when I open any of the files.
 

lennyla9

macrumors newbie
Original poster
Feb 18, 2007
4
0
That's not what I want it todo. I want the colour to change when the file is opened.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.