Mailing Lists: Apple Mailing Lists

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

Fw: Folder Action for changing privileges




Any takers on my little script below?

Ta muchly,

Coj

----- Forwarded by Brett Conlon/HU/AU/SonyDADC on 27/06/07 01:31 PM -----
Brett Conlon/HU/AU/SonyDADC

25/06/07 04:14 PM

To
Apple Script
cc
Subject
Folder Action for changing privileges




Hi all,

For some time now I've been successfully using a script application bundle for changing the permissions of the folder contents dropped onto it and today I tried making it into a folder action and, while it is successfully running, the permissions aren't changing. Here's the code:

on adding folder items to theFolder after receiving theAddedItems
        try
                repeat with thisItem in theAddedItems
                        set FilePath to quoted form of POSIX path of thisItem
                        do shell script "chmod -R 777 " & FilePath
                end repeat
                display dialog "Permissions changed successfully." buttons {"Thanks!"} default button 1
        on error
                display dialog "Changing permissions failed. Please try it manually" buttons {"OK"} default button 1
        end try
end adding folder items to

As a test, I set the "Other" privileges on all contents of a folder to "No access" then dropped it into the folder (with the action set to it) and the "success" message appears but permissions are the same. If I drop the same folder onto my bundle app (with same code) the "Others" permission correctly sets to "Read/write".

All assistance would be most appreciated!

Cheers,

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



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.