Re: [Slightly OT] Get Finder comments using Shell Script
Re: [Slightly OT] Get Finder comments using Shell Script
- Subject: Re: [Slightly OT] Get Finder comments using Shell Script
- From: Philip Aker <email@hidden>
- Date: Wed, 12 Dec 2007 05:11:34 -0800
On 2007-12-12, at 04:43:16, Rob Stott wrote:
Apologies in advance for being slightly off topic and asking what I
suspect may be a bit of a daft question...
I can get the Finder comments from a File's Info like this using
AppleScript;
set theFile to choose file
tell application "Finder"
set theComments to the comment of theFile
end tell
...but (for reasons far too long and boring to go into) I need to
get the same info using a shell script. I tried this;
mdls /Users/myname/Desktop/myfile.jpg | egrep
"kMDItemFinderComment" | cut -f2 -d"\""
...and that worked fine on my Mac. However, if I use it on files
residing on a mounted (non-Mac) volume then I don't get the Finder
Comment (although I do get a lot of other stuff such as creation
date, file type etc). The AppleScript above works fine in the same
scenario.
Is there any way of getting this info by using a shell script, or
am I wasting my time here?
What happens when you run the script with osascript?
osascript -e 'tell application "Finder" to get comment of ((POSIX
file "/Users/me/Desktop/file.rtf") as alias)'
Philip Aker
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden