Re: Applescript-Shell Error Question
Re: Applescript-Shell Error Question
- Subject: Re: Applescript-Shell Error Question
- From: Christopher Stone <email@hidden>
- Date: Sat, 15 Sep 2012 12:56:17 -0500
The problem is that xattr is returning a non-zero result code, which “do shell script” turns into a thrown error.
Right. I thought I could dump that to /dev/null and be done with it but apparently not. The AppleScript way to cope is with a try/error block.
Obviously. :) A Unix shell technique would be to end with a non-erroring command. Just as an example, try this:
Ah. I get it. Thanks for the tip.
Since you want the info from xattr, this isn’t a proper solution, but it does illustrate what you are asking about. ;)
In this particular case I don't want the info from xattr. I just want to turn off any quarantining in the front Finder window and get on with life.
However your tip gave me an idea for getting the output neatly from the shell:
tell application "Finder" set d to target of front window as string end tell set d to POSIX path of d set cmd to "cd " & quoted form of d & "; S=`xattr -d com.apple.quarantine * 2>&1`; echo \"$S\";" do shell script cmd without altering line endings
-- Take Care, Chris
|
_______________________________________________
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