• 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: Setting file comments (Finder info comments) in OS X
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting file comments (Finder info comments) in OS X


  • Subject: Re: Setting file comments (Finder info comments) in OS X
  • From: Graff <email@hidden>
  • Date: Thu, 20 May 2004 09:23:36 -0400

You can lock the file or change the write permissions on the file. If the file is locked and/or not writable to a user then the comments can't be changed.

You would lock the file by doing:
----
tell application "Finder"
set theComment to "here's a comment"
set comment of file "Users:usr1:Desktop:test.sh" to theComment
set locked of file "Users:usr1:Desktop:test.sh" to true
end tell
----

You can change the file to read-only permissions with:
----
tell application "Finder"
set theComment to "here's a comment"
set comment of file "Users:usr1:Desktop:test.sh" to theComment
set owner privileges of file "Users:usr1:Desktop:test.sh" to read only
set group privileges of file "Users:usr1:Desktop:test.sh" to read only
set everyones privileges of file "Users:usr1:Desktop:test.sh" to read only
end tell
----

- Ken

On May 20, 2004, at 4:00 AM, Ramakrishna Kondapalli wrote:

I am calling a Applescript to set the comments of a file(OS X file info
comments) from Cocoa. The code is pasted below. It is working fine. Now
i want to make the comments text as non editable. How can i do this?
_______________________________________________
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.


  • Follow-Ups:
    • Re: Setting file comments (Finder info comments) in OS X
      • From: Christopher Nebel <email@hidden>
    • Re: Setting file comments (Finder info comments) in OS X
      • From: Gnarlodious <email@hidden>
References: 
 >Setting file comments (Finder info comments) in OS X (From: "Ramakrishna Kondapalli" <email@hidden>)

  • Prev by Date: Re: applescript-users digest, Vol 3 #2696 - 14 msgs
  • Next by Date: Re: applescript-users digest, Vol 3 #2696 - 14 msgs
  • Previous by thread: Setting file comments (Finder info comments) in OS X
  • Next by thread: Re: Setting file comments (Finder info comments) in OS X
  • Index(es):
    • Date
    • Thread