How to run "sudo chmod" Folder Action?

My MacPro has a dedicated drive for photos taken by myself and my wife on our respective iPhones. However when I download photos from my iPhone then my wife cannot access them due to limited privileges. The solution is to chmod the files to 755. So I made a Folder Action with the following Run Shell Script
chmod -R 755 /Volumes/DATA/Camera\ Pictures
It works on my photos however it does not work on the photos that my wife uploads to the shared drive since I am not the owner of her iPhone photos. So I need to run the sudo command however I am unable to code an Automator Folder Action to accomplish this because it results in error with or without the sudo command in front of the chmod command. Could somebody assist?

I appreciate your assistance Niel. Here is my Run Applescript text:
on run {input, parameters}
  do shell script "chmod -R 755 '/Volumes/DATA/Camera\ Pictures/PHOTO\ VAULT/Photos\ per\ annum '" with administrator privileges
  return input
end run
I included the full path this time. I receive Syntax Error [Expected """ but found unknown token].

Similar Messages

  • How to set up Automator Folder Actions?

    I have set up and sucessfully tested a workflow which sends any file found in a particular folder to the "paperless" app, then moves all files to a different folder called "Archived attachments".
    HOWEVER as a folder action,  nothing happens when a file is put into the folder. The file just sits there in the folder.
    To create a folder action I opened  "new folder action" in Automator, then dragged and dropped the working workflow file into the workspace, then set "Folder Action recieves files and folders added to" the appropriate folder, let's call it "Attachments".
    Just to complicate things, the files are placed into the "Attachments" folder using an applescript that captures all pdf mail attachments. This applescript works succesfully.
    So, where could I be going wrong?
    The working workflow "Attachments.workflow" consists of:
    Get Specificed Finder Items
    Make Sequential
    Get Folder Contents
    Open Finder Items
    Get Folder Contwents
    Label Finder Items
    Get Folder Contents
    New Dated Folder
    The erronious Folder Action consists of:
    Run Workflow (Attachments)
    In folder actions setup:
    "Enable Folder Actions" is ticked
    "PDF Attachments" folder is ticked
    "Attachments_folder.workflow" script is on.

    I'm confused. You showed two Automator actions with the same name, one was a folder action one wasn't.
    Are you sure the correct Automator action (the one that is a folder action) is attached to the folder?
    If when the Folders Action setup window is opened and you select Articles_Folder.workflow and then edit script are you getting the right workflow?
    Assuming you do I would start off very simply. Try this:
    It will label green screen shot image files saved to the Desktop.
    See if this works for you.

  • How do I remove a folder action?

    I have a folder action applied to my downloads folder that is not working properly. How do I remove it?

    control-click on the downloads folder in finder and go to services->folder actions setup. remove the action from that folder in the resulting popup.
    Message was edited by: V.K.

  • Silly: but how do you remove a folder action

    I love this thing, i just cant for the life of me find how to remove a folder action I made!!! lol. Can you help!

    To remove it from the folder it's attached to, ctrl-click on that folder and scroll down to "Remove a folder action". To delete it entirely from your system, delete it from
    yourname/Library/Scripts/Folder Action Scripts/
    Cheers,
    H

  • How to run sudo remotely for adding workload with local /etc/vdb

    Hi Henk
    My controller and slaves are all ubuntu. When I would like to add raw disk I/O workload against remote local /etc/vdb, it's error out and said no permission.
    I try to either change user=root or run command with sudo. it doesn't like pass through to remote ( ubuntu might be not allow to log in as root without password )
    Any suggest regarding this scenario ?
    Johnny
    parmfile
    host=default,user=ubuntu,shell=ssh,vdbench=/home/ubuntu/vdbench
    *hd=localhost
    *hd=fio-drive-1,system=192.168.2.74
    hd=fio-drive-2,system=192.168.2.75
    *hd=fio-drive-3,system=192.168.2.76
    *hd=fio-drive-5,system=192.168.2.78
    sd=sd1,lun=/dev/vdb,openflags=o_direct,threads=200
    *sd=sd1,lun=/home/ubuntu/vdbench_installer/TEST/test,threads=20
    wd=wd1,sd=sd1,xf=1k,rdpct=50
    rd=rd1,wd=wd1,iorate=100,elapsed=5,interval=1
    error message
    Vdbench distribution: vdbench50402
    For documentation, see 'vdbench.pdf'.
    20:21:21.627 input argument scanned: '-fparmfs'
    20:21:21.636
    20:21:21.636 Specifying 'host=(xxx.yyy.com,host_x) has been deprecated.
    20:21:21.636 Please specify 'hd=host_x,system=xxx.yyy.com' instead.
    20:21:21.636 Vdbench will honor this parameter until the next release.
    20:21:21.636
    20:21:21.699 Starting slave: ssh 192.168.2.75 -l ubuntu /home/ubuntu/vdbench/vdbench SlaveJvm -m 192.168.2.5 -n 192.168.2.75-10-150318-20.21.21.598 -l fio-drive-2-0 -p 5570
    20:21:22.255 All slaves are now connected
    20:21:22.372 Raw device 'sd=sd1,lun=/dev/vdb' does not exist, or no permissions.
    20:21:22.372
    20:21:22.372 Please check above failures
    20:21:22.372
    java.lang.RuntimeException: Please check above failures
            at Vdb.common.failure(common.java:306)
            at Vdb.InfoFromHost.matchDataWithSds(InfoFromHost.java:679)
            at Vdb.InfoFromHost.receiveInfoFromHost(InfoFromHost.java:496)
            at Vdb.SlaveOnMaster.processSlave(SlaveOnMaster.java:154)
            at Vdb.SlaveOnMaster.run(SlaveOnMaster.java:42)

    here are the steps I try, I can generate the raw diso I/O  on remote ubuntu now.
    #sudo visudo
    add
    user ALL=NOPASSWD: /home/user/vdbench/vdbench -f parmfile
    at the last line
    ctrl-X + enter for exit
    thanks
    Johnny

  • Problem running multiple folder actions at the same time

    Hi,
    Does anyone have some experience running multiple folder actions at the same time?
    I've written a Applescript folder action that processes some files. When adding some files, the script starts and all goes well. The processing of each file takes a few minutes, but all files are processed correctly.
    However, when adding some new files to the dropfolder, while the folder action is all ready processing other files dropped a few minutes earlier, the process that is all ready running immediately aborts and the folder action is relaunched on the new files, leaving the old files for what they are...
    The same problem occurs with multiple folders, each having a folder action attached. When dropping files in "Folder A", the script starts processing. But if someone droppes files in "Folder B", The script of folder A aborts, and the script of folder B starts processing. When adding more files to the folders, the result is the same. In some casses, when the last dropped files are processed, the os continues where the operation was aborted on the previous files. But this not always happens. To make things worse, when you remove the items from the folders afterwords, the folder actions starts running again on items no longer present in the folder !!!!
    Does anyone know how I can prevent the folder action being aborted when new files are dropped and placing the new files in "Hold", until the previous files are processed? How can I prevent a folder action being aborted when a item is dropped into another folder?
    I've written a small script to test this behaviour. Just create one or more folders and attach the script below. Drop a item into the folder, wait a few seconds and drop another one in the same or another folder. To monitor what happens please check the console.
    on adding folder items to this_folder after receiving added_items
              set FolderName to this_folder as string
              set ItemName to added_items as string
              repeat with theIncrementValue from 1 to 15
      delay 2
                        do shell script ("logger \"Folder: " & FolderName & "  -  Item: " & ItemName & "  -  Step: " & theIncrementValue & "\"")
              end repeat
              do shell script ("logger \"Folder: " & FolderName & "  -  Item: " & ItemName & "  -  Done...\"")
    end adding folder items to
    Thanks for any feedback.

    That is pretty much the way Folder Actions work, especially since AppleScript is not multi-threaded.  If you are using them as some intermediate step in a workflow, you might rethink the way you are handling the files (for example, use a droplet instead).  Other options would be using launchd to watch a path or a shell script on a different thread.

  • Folder action to find and replace text and change line feeds

    I want to use a folder action to find and replace text and change Mac carriage returns to DOS line feeds inside text files.
    The text to be replaced is: "/Users/wim/Music/iTunes/iTunes Music/Music" (without the quotes)
    This text has to be removed (i.e. replaced by an empty string)
    The text occurs many times within each file.
    The files are playlists exported from iTunes in the M3U format (which are text files). They contain Mac carriage returns. These need to be changed to DOS line feeds.
    I have found the following two perl commands to achieve this:
    To find and replace text: perl -pi -w -e 's/THIS/THAT/g;' *.txt
    To change carriage returns to line feeds: perl -i -pe 's/\015/\015\012/g' mac-file
    I know that it's possible to make a folder action with Automator that executes a shell script.
    What I want to do is drop the exported playlists in M3U format in a folder so that the folder action will remove the right text and change the carriage returns.
    My questions are:
    Is it possible to make a folder action that executes command line commands instead of shell scripts?
    What is the correct syntax for the two commands when used in a folder action shell script? Especially, how do I escape the slashes (/) in the string to be removed?
    Thanks for your help

    Ok, I've include an applescript to run a shell command. The applesript command quoted form makes a string that will end up as a single string on the bash command line.  Depending on what you want to do, you may need multiple string on the bash command lines.  I've included some information on folder actions.
    It is easier to diagnose problems with debug information. I suggest adding log statements to your script to see what is going on.  Here is an example.
        Author: rccharles
        For testing, run in the Script Editor.
          1) Click on the Event Log tab to see the output from the log statement
          2) Click on Run
        For running shell commands see:
        http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html
    on run
        -- Write a message into the event log.
        log "  --- Starting on " & ((current date) as string) & " --- "
        --  debug lines
        set desktopPath to (path to desktop) as string
        log "desktopPath = " & desktopPath
        set unixDesktopPath to POSIX path of desktopPath
        log "unixDesktopPath = " & unixDesktopPath
        set quotedUnixDesktopPath to quoted form of unixDesktopPath
        log "quoted form is " & quotedUnixDesktopPath
        try
            set fromUnix to do shell script "ls -l  " & quotedUnixDesktopPath
            display dialog "ls -l of " & quotedUnixDesktopPath & return & fromUnix
        on error errMsg
            log "ls -l error..." & errMsg
        end try
    end run
    How to set up a folder action.
    1) right click on folder. click on Enable folder actions
    2) Place script in
    /Library/Scripts/Folder Actions Scripts
    3) right click on folder. click on attach folder action
    pick your script.
    Create a new folder on the desktop & try.
    You can put multiple folder actions on a folder. There are other ways of doing this.
    Here is my test script:
    on adding folder items to this_folder after receiving dropped_items
        repeat with dropped_item_ref in dropped_items
           display dialog "dropped files is " & dropped_item_ref & " on folder " & this_folder
        end repeat
    end adding folder items to
    How to  make the text into an AppleScript program.
    Start the AppleScript Editor
    /Applications/AppleScript/Script Editor.app
    In Snow Leopard it's at: /Applications/Utilities/AppleScript Editor
    Copy the script text to the Applescript editor.
    Note: The ¬ is typed as option+return.  ption+return is the Applescript line continuation characters.
    You may need to retype these characters.
    Save the text to a file as an script and do not check any of the boxes below.

  • Folder Action on Modification of a File

    How do I get a Folder Action to run when a file is modified, not just when one is added?

    you can't. The only available folder action handlers are:
    adding folder items, removing folder items, opening folder, closing folder window and moving folder window.
    you can do this for individual files by creating launch daemons but that's probably not what you want as you'd have to create a separate launch daemon for each file in your folder.

  • Applying a folder action to thousands of folders?

    I am pulling my hair out with this; I need to know the best way to do this. My client said he had "a thousand or so" eps files that he wanted bundled into specific groups, then duplicated as pdf, jpg, png and tif files, each group in its own subfolder with an excel file that lists each of the file names for each bundle. So, essentially, the structure would look something like this:
    Archive of Files (all of them)Bundles (ie., singles or multiples)Type of Bundles (ie, 5, 10, 25, 50, 100, 200)Groups and excel file (ie, "62697200376 - 62697200380")Filename Folder (ie, "62697200376", "62697200377", "62697200378", etc)
    filename.eps
    filename.tif
    filename.pdf
    filename.jpg
    filename.png
    Insane.
    Anyway, what he actually sent me was 99,997 files - not "a thousand or so". So now, thanks to applescripts and automator, I have managed to:
    - separate the archive of files into bundles
    - set up the types of bundles
    - Group the files (no excel file just yet, that'll be last)
    - run applescript to create a folder for each eps file and move that eps file into it's folder
    - have a working (and tested) workflow that will duplicate and convert each eps file to a pdf and save that pdf to the same folder.
    I also have folder actions that will duplicate the pdf files as tif, jpg, and png once the pdf file is saved.
    How can I attach these folder actions to these folders? Specifically the filename folders? I know that you're supposed to select each folder one at a time and then click on "Folder Actions Setup" to choose the actions, but there are nearly 100,000 folders that I need to get these three actions attached to before I can run the workflow. I don't think I will survive the eminent implosion that I will suffer if I have to attach these folder actions to each of the 99,997 folders one at a time (and I definitely wouldn't meet my deadline of having all this done).

    Thank you all for the replies.
    So, I know I'm doing something wrong, but I just can't seem to see it. In applescript editor, I have this (based on Camelot's script above):
    tell application "Finder"
        set theFolders to every folder of (choose folder) as alias list
    end tell
    tell application "System Events"
        repeat with eachFolder in theFolders
            try
                attach action to eachFolder using "/Library/Scripts/Folder Action Scripts/Image - Duplicate as PNG.scpt"
            end try
            try
                attach action to eachFolder using "/Library/Scripts/Folder Action Scripts/Image - Duplicate as JPG.scpt"
            end try
            try
                attach action to eachFolder using "/Library/Scripts/Folder Action Scripts/Image - Duplicate as TIFF.scpt"
            end try
        end repeat
    end tell
    First, I tried it without the try / end try but it kept telling me that it didn't understand the attach action message. After I added the try / end try, it goes through but the actions do not get attached and I get an error number -1708 like this:
    tell application "System Events"
        attach action to alias "[removed]:Bundles:5:first copy:62697200376 - 62697200380:UPC (A).62697200376:" using "/Library/Scripts/Folder Action Scripts/Image - Duplicate as PNG.scpt"
            --> error number -1708
        attach action to alias "[removed]:Bundles:5:first copy:62697200376 - 62697200380:UPC (A).62697200376:" using "/Library/Scripts/Folder Action Scripts/Image - Duplicate as JPG.scpt"
            --> error number -1708
        attach action to alias "[removed]:Bundles:5:first copy:62697200376 - 62697200380:UPC (A).62697200376:" using "/Library/Scripts/Folder Action Scripts/Image - Duplicate as TIFF.scpt"
            --> error number -1708
    The folder "First Copy" is a backup I made of some of the files; there are 200 folders in there, each containing 5 subfolders, and in the subfolder is the actual eps file. I figure if I can make something work on this small backup I can make it work on the actual folders / subfolders.

  • Script works in Script Debugger, but not a folder action - can u help?

    Hi
    I have written the following script to run as as folder action and it works fine when running it through in debug mode in Script Debugger, but as a folder action nothing happens.
    I wonder if someone could have a look and spot what the problem is.
    Thanks
    Nick
    on adding folder items to this_folder after receiving added_items
    set convertPath to "Macintosh HD:opt:local:bin:ffmpeg"
    tell application "Finder"
    set inPath to this_folder as alias
    set outPath to this_folder as alias
    set filesToConvert to (name of every item of inPath whose name extension is "m4a")
    end tell
    repeat with i from 1 to count of filesToConvert
    set fileName to removeExtension(item i of filesToConvert)
    do shell script POSIX path of convertPath & " -i " & (quoted form of ((POSIX path of inPath) & item i of filesToConvert)) & " -f mp3 -ar 44100 -ab 192k -acodec libmp3lame " & (quoted form of (POSIX path of outPath)) & quoted form of (fileName & ".mp3") & " -mapmetadata " & (quoted form of ((POSIX path of inPath) & item i of filesToConvert)) & ":" & (quoted form of (POSIX path of outPath)) & quoted form of (fileName & ".mp3")
    end repeat
    end adding folder items to
    to removeExtension(fileToParse)
    #display dialog fileToParse
    set prevTIDs to text item delimiters of AppleScript
    set text item delimiters of AppleScript to "."
    return first text item of fileToParse
    set text item delimiters of AppleScript to prevTIDs
    end removeExtension

    mmh, well, it seems something is awry with the triggering. other folder action scripts seemed to work fine, but now are intermittent.
    i created the following simple script:
    on adding folder items to this_folder after receiving added_items
    display dialog "1"
    end adding folder items to
    sometimes it works, sometimes not.
    what could be going wrong?

  • How to monitor contents of sub-folders in a Folder Action?

    Hello. I am wondering how I might read a folder's contentModDate within Terminal, i.e. from the command line and/or within a Folder Action.
    This is the situation: I am running Periscope Pro (PP) for motion-detected videos, which by default, places them within the user's ~/Movies/com.zipzapmac.Periscope-Pro folder. Within that folder, PP creates a folder with it's name based upon (a) machine name and (b) primary MAC address. For example, we'll pretend this folder is called MacPro(001122334455). Then within that folder, as PP is running in motion-detection mode, it creates a new folder based on the current date and then, within that, places videos when motion is detected. Very straight-forward and it works just fine.
    What I would like to do is have a folder action that (a) detects when any new folder or file is created within MacPro(001122334455) and (b) sends me a text-message via Apple Mail.
    If the MacPro(001122334455) folder is empty, I can create a Folder Action that will detect the creation of a sub-folder when the first motion-detected video is created and that successfully sends me a text-message, BUT if a second video is created later within the same date-named folder, I will not get a message. I would get a text-message on the following day as a new folder is created within MacPro(001122334455) that signals the first motion-detected video of the day, but again not subsequent videos on the same day.
    The text-message via Apple Mail I have easily scripted via Applescript and it works flawlessly.
    Since Folder Actions only work upon a single pre-defined folder and not on sub-folders, I can never get automatically notified via text-message of second/third/fourth/etc. motion-detected videos as they're created... only the first one of each day.
    So, I'm wondering whether there's a different way, perhaps through launchd that I might script this process. I'm thinking that if the contentModDate value of the MacPro(001122334455) folder could be read, compared with the last known value, and then---if different---execute the Applescript. OR PERHAPS I'm going about this all wrong and you might have another, better idea?
    I'm open to suggestions.
    -- David (da2357)

    Well, I found a solution that does not use a Folder Action. Since Folder Actions will only work upon the specified folder and not upon the contents of any sub-folders, I needed a different solution.
    First, I launched Terminal and created a new file called monitorPeriscope. I set executable permissions (chmod 700 monitorPeriscope). The contents of the file:
    #!/bin/bash
    # monitor the size of a specified folder and
    # when the size increases, run an applescript
    # copyright 2013, david dot allie at me dot com
    # you are welcome to use this script, but please attribute authorship.
    # CONSTANTS
    WATCHFOLDER="/users/xadmin/movies/com.zipzapmac.Periscope-Pro"
    SIZEFILEONE="/users/xadmin/.bin/foldersizeone"
    SIZEFILETWO="/users/xadmin/.bin/foldersizetwo"
    MYAPPLESCRIPT="/users/xadmin/documents/dropbox/programming/applescript/motion_de tected_text.scpt"
    # START
    # calculates current size of watchfolder, saves to sizefiletwo, then
    # performs a diff operation, result which is evaluated in if statement,
    # and if different, runs applescript, and copy sizefiletwo to sizefileone
    du -h -k -d3 -c $WATCHFOLDER | awk 'END{print}' | awk '{print $1}' > $SIZEFILETWO
    diff --brief $SIZEFILEONE $SIZEFILETWO
    if [ $? -eq 1 ]
      then
        osascript $MYAPPLESCRIPT
        cp -f $SIZEFILETWO $SIZEFILEONE
    fi
    exit 0
    Next, I created the following Applescript, replacing Some User, [email protected] and the text address of [email protected] below with my real values.
    using terms from application "Mail"
    tell application "Mail"
    set theName to "Some User"
    set theAddress to "[email protected]"
    set theContent to "Motion detected in OFFICE."
    set newMessage to make new outgoing message
    tell newMessage
    make new to recipient at end of to recipients with properties {name:theName, address:theAddress}
    set visible to true
    set sender to "[email protected]"
    set subject to "ALERT "
    set content to theContent
    send newMessage
    end tell
    end tell
    end using terms from
    Next, using the touch command, I created /users/xadmin/.bin/foldersizetwo and /users/xadmin/.bin/foldersizetwo as needed for the bash shell script (touch /users/xadmin/.bin/foldersizeone and touch /users/xadmin/.bin/foldersizetwo).
    Next, still in Terminal, I navigated to ~/Library/LaunchAgents and created the following plist using nano, which I named com.xadmin.monitorPeriscope.plist:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
              <key>Disabled</key>
              <false/>
              <key>Label</key>
              <string>com.xadmin.monitorPeriscope</string>
              <key>ProgramArguments</key>
              <array>
              <string>/users/xadmin/.bin/monitorPeriscope</string>
              </array>
              <key>RunAtLoad</key>
              <true/>
              <key>StartInterval</key>
              <integer>900</integer>
    </dict>
    </plist>
    Finally, all that was needed was to log out and then log back in. Once I launched the Periscope Pro app and started the motion-detection mode, I left my office... and within fifteen minutes I received a text message indicating that motion had been detected in my office. In the plist above, I set a StartInterval of 900 seconds, which corresponds to 15 minutes. I can reduce it down to 300 seconds (5 minutes) without it adversely affecting performance, but I'm going to leave the setting where it is for now.
    So, I solved my own problem and I'm pleased with the results.
    -- David

  • How to Attach Script to Photoshop Action or Folder?

    I'm not familiar with Applescript at all! However, I downloaded a script for use with Photoshop which crops an image to a specific format. It works great if I've got an image open in Photoshop.
    What I can't figure out how to do is to either apply that script to an entire folder to process all images in that folder, or better yet, record a Photoshop Action that uses that script.
    How can I use that script to do a batch process from either Photoshop or the Finder?
    Thanks for any help for this total newbie.

    The Mac I am currently using does not have 'Adobe Photoshop CS3' installed. However, based on [1], the code samples should work. Some editing may be needed, based on your specific requirements.
    Sample code01:
    -- Code starts here --
    on run ()
    my handle_Items(choose folder with multiple selections allowed)
    end
    on open (dItems)
    my handle_Items(dItems)
    end
    on handle_Items(tItemss)
    tell application "Adobe Photoshop CS3"
    repeat with i in tItemss
    set fList to list folder i without invisibles
    repeat with j in fList
    try
    open file ((i as string) & j)
    try
    set docRef to current document
    set (docWidth,docHeight) to (width of docRef,height of docRef)
    set minDimension to docWidth
    if docWidth > docHeight then set minDimension to docHeight
    crop docRef bounds {(docWidth - minDimension) / 2, (docHeight - minDimension) / 2, (docWidth + minDimension) / 2, (docHeight + minDimension) / 2}
    save current document
    close current document saving no
    end try
    end try
    end repeat
    end repeat
    end tell
    end handle_Items
    -- Code ends here --
    Save the code as an application (AppleScript 'applet').
    You and then either double click on the applet - and navigate to and select a desired folder (or folders), of which its / their contents will be processed; or, you can drag a folder (or folders) onto the applet, of which the folders contents will be processed.
    Code sample02:
    -- Code starts here --
    on adding folder items to tFolder after receiving tItems
    tell application "Adobe Photoshop CS3"
    repeat with i in tItems
    try
    open file (i as string)
    try
    set docRef to current document
    set (docWidth,docHeight) to (width of docRef,height of docRef)
    set minDimension to docWidth
    if docWidth > docHeight then set minDimension to docHeight
    crop docRef bounds {(docWidth - minDimension) / 2, (docHeight - minDimension) / 2, (docWidth + minDimension) / 2, (docHeight + minDimension) / 2}
    save current document
    close current document saving no
    end try
    end try
    end repeat
    end tell
    end adding folder items to
    -- Code ends here --
    See 'Folder Actions Reference' about AppleScript Folder Actions; and, 'Running an automation when a folder is changed' for attaching an AppleScript Folder Action.
    [1] - Consult 'photoshopcs3_applescriptref.pdf' for Adobe Photoshop AppleScript classes and commands.

  • Running chown in a Folder Action

    When I drop a file into my Drop Box from another machine (Mac or Windows) on my network, the file's owner is set to 'nobody'. I would like the owner to be set to my user name 'steve'. I wrote the following script and assigned it as a Folder Action to my Drop Box:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #FFEE80;
    overflow: auto;" title="this text can be pasted into the Script Editor">on adding folder items to this_folder after receiving these_items
    try
    set the item_count to the number of items in these_items
    tell application "Finder"
    repeat with this_item in these_items
    set this_path to the quoted form of the POSIX path of this_item
    set this_script to ("/usr/sbin/chown steve " & this_path)
    --display dialog this_script buttons {"OK"}
    do shell script this_script user name "root" password "my root password" with administrator privileges
    end repeat
    end tell
    on error error_message number error_number
    if the error_number is not -128 then
    tell application "Finder"
    activate
    display dialog error_message buttons {"Cancel"} default button 1 giving up after 120
    end tell
    end if
    end try
    end adding folder items to</pre>
    When I drop a file into the folder, I get the error message "Finder got an error: A privilege violation occurred." (If I uncomment the "display dialog" line, the shell command looks correct.)
    Is there a way to run chown from a Folder Action?
    What I really want to know is if there's a way to make me the owner of any files dropped into my Drop Box but that's not an AppleScript question.

    Can you confirm that you have the root user enabled for login? For security reasons (as the PW is stored in the script), I would recommend replacing
    do shell script this_script user name "root" password "my root password" with administrator privileges
    with
    do shell script this_script user name "your Admin shortname" password the_password with administrator privileges
    at the beginning of the script, place this line:
    set the_password to text returned of (display dialog "Enter Administrator Password" default answer "" with hidden answer)
    as there is no reason to run the script with root as you are. A regular admin account will suffice. The "with administrator privileges" is equivalent to running a command with "sudo".

  • Folder Actions script no longer runs on new file creation

    Hope this isn't trivial.......first time posting here...hopefully in the right place.I'm not a total Mac OS X newbie...and surely no techie, either. Dabbled a wee bit with Automator and scratchin' my head on this one. Help, please!
    Any idea why folder actions not running when a new file is saved? A simple add-color-label script created in Automator was workin' fine before I did a Snow Leopard-to-Leopard downgrade clean-install & account migration from external HD (TimeMachine) backup. Folder actions are enabled and script runs only if I start it with Automator Runner. Previously, it would label the file as soon as I saved it....now it needs a manual start. Is this default behavior in Leopard? Or am I missing something or doin' something wrong? Or is this a consequence of downgrade? I was sure I had the same script workin ok in my original Leopard install - though possibly un-modified at that time.
    I have no clue why, but the new version I created recently (cpl wks ago?)worked the first time I added a new file but not thereafter...and in that instance it only labelled the file in Finder upon quitting Preview (file is a Grab saved as pdf).
    The reason for the downgrade was compatibility problems with Photoshop CS4 on SL (OS & app all updated yet crashin' at the drop of a hat) - maybe due to lack of RAM? (only 1GB). Saw quite a few posts regarding SL running CS4 problems, so now I'm back to running 10.5.8 ..again.. and PS actually runs smooth like it did before.
    Maybe these console messages are a help......or am I barkin' up the wrong tree?
    6/11/11 7:44:54 PM /System/Library/CoreServices/Folder Actions Dispatcher.app/Contents/MacOS/Folder Actions Dispatcher[91] CPSGetProcessInfo(): This call is deprecated and should not be called anymore.
    6/11/11 7:44:54 PM /System/Library/CoreServices/Folder Actions Dispatcher.app/Contents/MacOS/Folder Actions Dispatcher[91] CPSPBGetProcessInfo(): This call is deprecated and should not be called anymore.
    6/11/11 7:44:54 PM /System/Library/CoreServices/AppleScript Runner.app/Contents/MacOS/AppleScript Runner[264] CPSGetFrontProcess(): This call is deprecated and should not be called anymore. 
    6/11/11 8:19:12 PM Automator Runner[415] Error while processing arguments
    6/11/11 8:20:31 PM /Applications/AppleScript/Folder Actions Setup.app/Contents/MacOS/Folder Actions Setup[420] CPSGetProcessInfo(): This call is deprecated and should not be called anymore.
    6/11/11 8:20:31 PM /Applications/AppleScript/Folder Actions Setup.app/Contents/MacOS/Folder Actions Setup[420] CPSPBGetProcessInfo(): This call is deprecated and should not be called anymore.
    6/11/11 8:20:32 PM [0x0-0x5b05b].com.apple.systemevents[421] com.apple.FolderActions.enabled: Already loaded
    And for that matter....why does Automator throw these messages? All apps (except iWork '08 apps) and OS are up to date.
        - Just a few of the many actions not loaded:
    6/11/11 7:48:25 PM Automator[294] The action “Start iTunes Visuals” could not be loaded because the application “iTunes” is the wrong version.
    6/11/11 7:48:25 PM Automator[294] The action “Stop iTunes Visuals” could not be loaded because the application “iTunes” is the wrong version.
    6/11/11 7:48:25 PM Automator[294] The action “Update iPod” could not be loaded because the application “iTunes” is the wrong version.
    6/11/11 7:56:33 PM Automator[294] name = name was not found
    6/11/11 7:56:33 PM Automator[294] name = name extension was not found
    6/11/11 7:56:33 PM Automator[294] name = file type was not found
    6/11/11 8:00:29 PM Automator Runner[339] Error while processing arguments
    6/11/11 8:00:30 PM Automator Runner[339] The action “Import Files into iTunes” could not be loaded because the application “iTunes” is the wrong version.
    6/11/11 8:00:30 PM Automator Runner[339] The action “Add Songs to iPod” could not be loaded because the application “iTunes” is the wrong version.
    6/11/11 8:00:30 PM Automator Runner[339] The action “Add Songs to Playlist” could not be loaded because the application “iTunes” is the wrong version.
    6/11/11 8:00:30 PM Automator Runner[339] The action “Apply SQL” could not be loaded because the application “Xcode” was not found.
    Do I need to wipe the drive again and re-install everything?
    Any help is greatly appreciated. Apologies if this seems long-winded.

    Folder Actions are set up a bit differently in Leopard (they use an AppleScript wrapper), and several actions have been updated to use new technologies available in Snow Leopard.  Looking at some of your console logs, it looks like some actions or workflows were just copied over from Snow Leopard.  When changing versions like that, you should rebuild the workflows so that they link to the correct actions, and check added actions for any dependencies (an action won't be loaded if it requires resources that are not available).
    Resaving your Folder Action workflow as a Folder Action Plug-in should do the trick.

  • How to run a search query for a particular folder in KM related to portal

    Hi,
    Can any one tell me the steps for : how to run a search query for a particular folder in knowledge management related to portal.
    Answers will be rewarded.
    Thanks in advance.
    KN
    Edited by: KN on Mar 18, 2008 6:33 AM

    Ok u may not require a coding
    But u req configuration
    U should first make a search option set
    Link: [Search Option set|http://help.sap.com/saphelp_nw04/helpdata/en/cc/f4e77ddef1244380b06fee5f8b892a/frameset.htm]
    Then u need 2 duplicate a KM Command by the name Search From here
    and customize it to include the Search Option that u have created
    Link: [Search from here|http://help.sap.com/saphelp_nw04/helpdata/en/2a/4ff640365d8566e10000000a1550b0/frameset.htm]
    Then in the layout add this command.
    Regards
    BP

Maybe you are looking for

  • ISight in use but is not in use

    I was trying to video chat in iChat with no other programs open and my computer told me my iSight was in use, so I tried restarting my computer, opened photo booth and only photo booth and again it told me iSight was in use, so I then turned off my c

  • Printing Pics in Document

    My printer will not print pictures inserted into a Word document. The text portion of the document prints, but it just ignores the pictures regardless of how they have been inserted. My printer is an HP deskjet F4140.

  • Adding the capability to 3PL for customers to our SD/LE/IM/WM setup

    Looking to solve a problem where we perform the service of a 3PL for our customers.  Our customer stocks inventory at our warehouse (IM/WM implementation) and will subsequently place orders for us to deliver (with WM TO) materials to their locations

  • Facebook Posts and Sounds Option

    Hi, my question regards the Facebook App and the function of Facebook Posts in the Sounds Menu.      I want to know if this has happened to other people, if its considered normal or if its an actual problem of my Ipad. The option of Facebook Posts in

  • Adobe flash player & shockwave crash

    Desktop HP model #p6654y ....     Adobe flash player & Shockwave crash a lot while playing games. What can i do to correct this problem??