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 > Developer Center > Batch Commenting Files.

Batch Commenting Files.
Thread Tools
bmx269
Guest
Status:
Reply With Quote
Sep 20, 2000, 01:10 PM
 
What is a simple applescript to add a comment to files dropped on it or in a folder, and not lose the comments that are already there, sort of like IE puts the url in the comment of the downloaded file.




------------------
********bmx269********
     
Mark Hartman
Guest
Status:
Reply With Quote
Sep 21, 2000, 10:55 AM
 
on open theItems
repeat with theItem in theItems
tell application "Finder" to set the comment of theItem to "Hi there"
end repeat
end open
     
oaf
Guest
Status:
Reply With Quote
Sep 21, 2000, 05:25 PM
 
Sorry, Mark, but you missed the part where bmx269 said "and not lose the comments that are already there."

Your script works for adding the comments, but it doesn't preserve the old comments. Here's my version:

on open the_files
repeat with a_file in the the_files
tell application "Finder"
set old_comment to comment of item a_file
set comment of item a_file to old_comment & " Here are some new comments!"
end tell
end repeat
end open

Hope that helps!

oaf
     
bmx269
Guest
Status:
Reply With Quote
Sep 22, 2000, 05:49 PM
 
Thanks oaf and mark,

That script works great, now I need it to comment all the files in a folder I drop onto the script. So say I wanted to comment a whole drive at one, just drop the drive and it comments all the files. Right now it comments only the one dropped onto the script.


------------------
********bmx269********
     
   
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 08:02 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