Re: Folder Action for changing privileges
Re: Folder Action for changing privileges
- Subject: Re: Folder Action for changing privileges
- From: "J. Stewart" <email@hidden>
- Date: Fri, 29 Jun 2007 04:53:59 -0400
On 6/29/07 at 2:45 AM, Brett Conlon <email@hidden>
spake thusly:
repeat with thisItem in theAddedItems set FilePath to quoted
form of POSIX path of thisItem do shell script "chmod -R 777 "
& FilePath end repeat
You may be getting bitten by a long standing gotcha of repeating
by reference. Try this instead (I didn't test).
repeat with thisItem in theAddedItems
set FilePath to quoted form of POSIX path of (contents of thisItem)
do shell script "chmod -R 777 " & FilePath
end repeat
When you loop using the above form what you are really getting
when you refer to "thisItem' is "item x of theAddedItems" and
not a file path. The addition of "contents of" to the script
forces it to resolve the reference into the actual file path it contains.
JBS
--
It is inaccurate to say I hate eveything. I am strongly in favor
of common sense, common honesty, and common decency. This makes
me forever ineligible for any public office. - HL Mencken
_______________________________________________
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