script that imports comments from 9 into X
script that imports comments from 9 into X
- Subject: script that imports comments from 9 into X
- From: Mr Tea <email@hidden>
- Date: Thu, 4 Apr 2002 23:09:39 +0100
Oh happy day. My script that reads 'get info' comments in OS 9 and writes
them to the appropriate items in OS X works!
I've used comments fairly extensively (for things like annotating folders
full of script snippets) since they became robust enough to survive
through desktop rebuilds. Sadly, they are lost to sight with the move to
X... AppleScript to the rescue.
The following works as a droplet in OS 9 (storing the comments in an on-
board property), and as a regular applet in OS X (where it finds the
original folder and re-comments the contents). At present it only goes
one level deep and only accepts a single folder. I'd welcome any
suggestions for smartening it up and extending its scope.
----------->
property theComments : {}
property targetFolder : {}
on open {theFolder}
set theDisk to path to startup disk
if theDisk is alias "Basement!:" then
set my targetFolder to theFolder
tell application "Finder"
set my theComments to comment of every item of theFolder
set name of file ((path to me) as string) to name of theFolder & " - X"
end tell
end if
end open
set theDisk to path to startup disk
if theDisk is alias "Mezzanine!:" then
try
set theList to list folder targetFolder without invisibles
on error
display dialog "The target folder has not been set" buttons {"Drat!"}
default button 1 with icon 2
end try
set tally to 1
repeat with theName in theList
set theItem to ((targetFolder as string) & theName) as alias
tell application "Finder"
set comment of theItem to (item tally of theComments)
end tell
set tally to tally + 1
end repeat
else
display dialog
end if
-----------<
Thanks
Mr Tea
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.