Re: set comment for a directory.
Re: set comment for a directory.
- Subject: Re: set comment for a directory.
- From: Michael Gmail <email@hidden>
- Date: Fri, 25 Feb 2005 13:47:28 -0600
On Feb 25, 2005, at 10:45 AM, Klaas.Lists wrote:
I want to use the info information to identify
my files and also directories.
With the 'set comment' command I can do this
for files. For a directory(folder) I somehow
cannot do this.
Is there anyone who has experienced the same?
Someone who has code that works for a folder?
Btw. it works well when I use the get info
from the Finder menu, but I was planning to use
(applescript) code
The code below works on files or folders. It's designed to run from Big
Cat, from the script menu operating on the Finder selection, or as a
droplet. Watch the line breaks. Oh, and there are curly quote
characters in there that will probably be straightened out in the mail,
so you'll either have to re-curlify them when you paste in the script,
or just delete them.
Michael
-- (C) 2003-4 Blue Danube Software
on run
tell application "Finder" to set filelist to selection as list
my proc(filelist)
end run
on open filelist
my proc(filelist)
end open
on |main|(filelist)
my proc(filelist)
end |main|
on proc(TheFiles)
repeat with aFile in TheFiles
tell application "Finder"
set theName to the name of aFile
set cmt to the comment of aFile
if cmt is not "" then
set theResponse to (display dialog ("The item “" & theName & "”
already has a comment." & return & "Replace with new comment or
cancel.") default answer cmt buttons {" Cancel ", "OK"} default button
"OK")
else
set theResponse to (display dialog ("Enter comment for item “" &
theName & "”:") default answer "" buttons {" Cancel ", "OK"} default
button "OK")
end if
if the button returned of theResponse is "OK" then set the comment
of aFile to the text returned of theResponse
end tell
end repeat
end proc
--
<http://globalocal.blogspot.com/>
"It is advisable to be two people during construction."
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden