Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Folder Action for changing privileges



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:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/archives/applescript-users


This email sent to email@hidden
References: 
 >Re: Folder Action for changing privileges (From: Brett Conlon <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.