• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: set comment for a directory.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >set comment for a directory. (From: "Klaas.Lists" <email@hidden>)

  • Prev by Date: Re: About password fields
  • Next by Date: Re: About password fields
  • Previous by thread: Re: set comment for a directory.
  • Next by thread: Re: set comment for a directory.
  • Index(es):
    • Date
    • Thread