• 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: Fri, 21 May 2004 10:05:04 -0400

There's no way to do that that I know of. If a person can edit the file they can edit the comments.

- Ken

On May 21, 2004, at 8:15 AM, Ramakrishna Kondapalli wrote:

Hi,
Is there any way by which i can make the finder's comment text as non
editable but file should be editable to the user? Because when i locked
the file ( chflags uchg <file Name>) , it is not allowing the user to
edit also.

Thanks & Regards,
Ramakrishna

----------
From: Graff
Sent: Friday, May 21, 2004 8:14 AM
To: AppleScript Users
Subject: Re: Setting file comments (Finder info comments) in OS
X

On May 20, 2004, at 9:37 PM, Christopher Nebel wrote:

On May 20, 2004, at 6:23 AM, Graff wrote:

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
----

Since they're already using Cocoa, chmod(2) and chflags(2) would
probably be more appropriate. Faster, certainly. (Use the uchg flag
for locking the file.)

True, I was just relaying the AppleScript way since it was posted to an
AppleScript list.
_______________________________________________
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.


References: 
 >RE: Setting file comments (Finder info comments) in OS X (From: "Ramakrishna Kondapalli" <email@hidden>)

  • Prev by Date: preventing classic launch
  • Next by Date: Re: applescripts 32k limit
  • Previous by thread: RE: Setting file comments (Finder info comments) in OS X
  • Next by thread: Add to startup items
  • Index(es):
    • Date
    • Thread