Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Basic Applescript Help

Basic Applescript Help
Thread Tools
Mac Elite
Join Date: Jun 2001
Location: Utah
Status: Offline
Reply With Quote
Feb 4, 2004, 10:32 PM
 
Hi all.

Mods, please move this if it's in the wrong place.

I need help finding/writing an applescript. Here's what I'd like to do:

My students email me their essays so I can comment on them. I'd like to be able to attach an applescript to the folder I keep them in that sets the label for any item added to it to "red."

Can anyone help?

Thanks in advance.

Cheers
Scott
     
Mac Elite
Join Date: May 2001
Status: Offline
Reply With Quote
Feb 4, 2004, 11:38 PM
 
If you know how to attach scripts to folders try this:
Code:
on adding folder items to this_folder after receiving these_items try repeat with this_item in these_items tell application "Finder" to set label index of this_item to 2 end repeat on error error_message number error_number if the error_number is not -128 then tell application "Finder" activate display dialog error_message buttons {"Cancel"} default button 1 giving up after 120 end tell end if end try end adding folder items to
Hope that helps.

-
     
Mac Elite
Join Date: Jun 2001
Location: Utah
Status: Offline
Reply With Quote
Feb 5, 2004, 12:15 AM
 
Thanks! Unfortunately, unless I'm doing something wrong, it's not working.
     
Mac Elite
Join Date: May 2001
Status: Offline
Reply With Quote
Feb 5, 2004, 12:53 AM
 
Originally posted by midwinter:
Thanks! Unfortunately, unless I'm doing something wrong, it's not working.
For me it works fine.
You need to put in in your in either your private or the global "Folder Action Scripts" folder and turn Folder Actions on and attach it to your folder.

http://www.apple.com/applescript/folderactions/

-
     
Mac Elite
Join Date: Jun 2001
Location: Utah
Status: Offline
Reply With Quote
Feb 5, 2004, 01:08 AM
 
Originally posted by Moonray:
For me it works fine.
You need to put in in your in either your private or the global "Folder Action Scripts" folder and turn Folder Actions on and attach it to your folder.

http://www.apple.com/applescript/folderactions/

-
A-ha!

Thankyouthankyouthankyou!!!
     
Mac Elite
Join Date: May 2001
Status: Offline
Reply With Quote
Feb 5, 2004, 01:24 AM
 
Welcome

-
     
Mac Elite
Join Date: Jun 2001
Location: Utah
Status: Offline
Reply With Quote
Feb 5, 2004, 01:31 AM
 
Originally posted by Moonray:
Welcome

-
You have to understand two things:

1) I will get somewhere around 80 essays via email to comment on between now and Monday.

2) I never understood the big deal about labels until I started using them to indicate which ones I'd commented on and which ones I hadn't. Now, the ones that are red are new, the ones that are finished are green. And so, because I've discovered the amazing usefulness this thing that Mac users have been on to for what, a decade (?), my life is a little easier.

And you have helped immensely.

Thanks, again.

Cheers
Scott
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 03:03 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2