Plug-in/Folder Actions no work, Drop App works

I've been trying to get the automator actions from here (http://www.apple.com/pro/techniques/automator/) to work. I save the plug-in and activate it as a folder action script. When a new item is added the the folder the contains the action script, the script runs but does nothing.
I save the action script as a drop application, and it works as expected.
I would really rather have the folder action working. Is there something I need to do to get it to work?
Karl

IT WORKED! I had to create the entire file and folder structure and then put ACR 3.7 in there, but it worked.
Thanks again, Jim!

Similar Messages

  • Folder Actions not working

    I'm trying out folder actions for the first time, and I cannot get an action to trigger.
    I regularly use Automator, and I've saved a script as a Folder Action plug-in attached to a folder. I've tried this with several different scripts.
    For example, I've got a script that just displays a message. It works fine if I save it as an app, so I save it as a Plug In>Folder Action. If I select, say, my documents folder, I right click>more>attach a folder action. I then select my script. If I open the Folder Actions Setup, my script is listed as attached to my documents folder. However, if I drop a file into the Documents folder, nothing happens.
    Am I correct in thinking that the script should run when a file is dropped into the folder (and if I'm wrong, how would you do this?), or have I missed something?
    I'm using 2x 2,8GHz Quad-Core Intel Xeon Mac, OsX 10.5.6.
    Cheers
    Steve

    In the Finder (Mac) Help, every user may read:
    *+Running an automation when a folder is changed+*
    +Folder actions let you run automations when a folder is modified. For example, you could run an AppleScript or an Automator workflow whenever something is added to a dropbox folder.+
    +To use folder actions, you attach a folder action script or workflow to a folder. When the folder is opened, closed, or modified, the automation will be activated automatically.+
    +Your script must include a handler for each folder action command used.+
    +To make a folder action scripts available to all users of your computer, put them in the Folder Action Scripts folder located at:+
    +Library/Scripts/Folder Action Scripts/+
    +To make the scripts available only to the current user, put them in the home folder at:+
    +~/Library/Scripts/Folder Action Scripts/+
    *+To enable folder actions:+*
    +1. Open Folder Actions Setup in the Applications/AppleScript folder.+
    +2. Select Enable Folder Actions.+
    +3. Click the ╋ button below the Folders with Actions list and choose the folder containing the folder actions.+
    +4. Click the ╋ button below the Script list and select the desired scripts, then click Attach.+
    My guess is that you missed one of the four steps.
    Yvan KOENIG (from FRANCE vendredi 5 juin 2009 17:09:05)

  • Can't Get Folder Action To Work...

    Hi guys.  I'm working on an Applescript -- a Folder Action, to be precise -- which will, when files are dropped onto or added to my Downloads folder, automagically sort them into pre-existing folders, depending upon what kind of file they are.  But for the LIFE of me, I simply cannot get it to work.  I attach the script to the Folder using Configure Folder Actions (or as it appears in the context menu, "Folder Actions Setup"), and then drop files onto the folder and . . . nothing.  But I know that Folder Actions themselves are working, because I have a few others that I wrote myself that are working just fine.  I tried repairing permissions, but that didn't do any good.  Any ideas?  Here's the code below.   You'll notice that there is a section that's been commented out; mainly because I couldn't figure out how to do it without using recursion, and thus breaking up the script into subroutines, which I've heard you're not supposed to do with Folder Actions.  If someone could please explain what the heck I'm doing wrong and possibly provide a solution, I'd be really, really appreciative.  Anyway, the code:
    on adding folder items to this_folder after receiving these_items
    set imageTypesList to {"JPEG image", "Portable Network Graphics image", "Windows bitmap image", "Graphics Interchange           Format image", "Adobe Photoshop File", "TIFF Image"}
    set audioTypesList to {"MP3 audio", "AIFF-C audio", "Waveform audio"}
    set videoTypesList to {"Video-MPEG4", "MPEG-4 File", "Video-MPEG2", "Video-MPEG", "AVI", "Matroska Video File"}
    set fontTypesList to {"TrueType font", "PostScript® Type 1 outline font", "Font Suitcase"}
    set docsTypesList to {"Portable Document Format (PDF)", "Scrivener Project", "Microsoft Word 97 - 2004 document", "Rich Text           Document", "Plain Text Document", "CSV Document", "Pages Publication"}
    set epubTypesList to {"epub", "Kindle Document", "iBooks Author Template", "iBooks Author Book"}
    set archTypesList to {"ZIP archive", "tar archive", "rar archive", "Tar Gzip Archive"}
    set diskTypesList to {"Installer package", "Disk Image"}
    set execTypesList to {"Application (32-bit)", "Application", "Unix Executable File"}
    set webTypesList to {"HTML document", "XML document", "XHTML document", "Cascading Style Sheet"}
    set iconTypesList to {"Apple Icon Image", "Icon Container", "Windows Icon Image"}
    set otherTypesList to {"XTorrent File"}
    set uberList to imageTypesList & audioTypesList & videoTypesList & fontTypesList ¬                      & docsTypesList & epubTypesList & archTypesList & diskTypesList & execTypesList ¬
               & webTypesList & iconTypesList & otherTypesList\
    set imagesFolder to "Technomage:Users:andyhainline:Downloads:Images" as alias
    set appsFolder to "Technomage:Users:andyhainline:Downloads:Apps" as alias
    set archivesFolder to "Technomage:Users:andyhainline:Downloads:Archives" as alias
    set epubFolder to "Technomage:Users:andyhainline:Downloads:eBooks" as alias
    set fontsFolder to "Technomage:Users:andyhainline:Downloads:Fonts" as alias
    set docsFolder to "Technomage:Users:andyhainline:Downloads:PDFs and Docs" as alias
    set diskFolder to "Technomage:Users:andyhainline:Downloads:Installers and Disk Images" as alias
    set iconFolder to "Technomage:Users:andyhainline:Downloads:Icons" as alias
    set audioFolder to "Technomage:Users:andyhainline:Downloads:Audio" as alias
    set videoFolder to "Technomage:Users:andyhainline:Downloads:Video" as alias
    set otherFolder to "Technomage:Users:andyhainline:Downloads:Torrent Files" as alias
    set miscFolder to "Technomage:Users:andyhainline:Downloads:Miscellanious" as alias
    repeat with anItem in these_items
      set itemInfo to info of anItem
      if (kind of itemInfo) is in imageTypesList then
      move file itemInfo to imagesFolder
      else if (kind of itemInfo as text) is in audioTypesList then
      move file anItem to audioFolder with replacing
      else if (kind of itemInfo as text) is in videoTypesList then
      move file anItem to videoFolder with replacing
      else if (kind of itemInfo as text) is in fontTypesList then
      move file anItem to fontsFolder with replacing
      else if (kind of itemInfo as text) is in docsTypesList then
      move file anItem to docsFolder with replacing
      else if (kind of itemInfo as text) is in epubTypesList then
      move file anItem to epubFolder with replacing
      else if (kind of itemInfo as text) is in archTypesList then
      move file anItem to archivesFolder with replacing
      else if (kind of itemInfo as text) is in diskTypesList then
      move file anItem to diskFolder with replacing
      else if (kind of itemInfo as text) is in execTypesList then
      move file anItem to appsFolder with replacing
      else if (kind of itemInfo as text) is in webTypesList the
              move file anItem to docsFolder with replacing
      else if (kind of itemInfo as text) is in iconTypesList then
               move file anItem to iconFolder with replacing
      else if (kind of itemInfo as text) is in otherTypesList then
               move file anItem to otherFolder with replacing
      else if (kind of itemInfo as text) is not in uberList then
               move file anItem to msicFolder with replacing
      (*                              else if (kind of anItem as text) is "Folder" then
                                            set folderFiles to get every file of anItem
                                            processItems(folderFiles)
      end if
         end repeat
    end adding folder items to

    Well, I followed your instructions to letter, but the folder action still isn't triggering, or if it is, it isn't executing properly.  I can't figure out what's going on.  I tried executing the script directly from Script Debugger, but it just sits there, doing nothing (since it has no input, I would guess).  Any ideas on what's wrong?
    on adding folder items to this_folder after receiving these_items
         set imageTypesList to {"JPEG image", "Portable Network Graphics image", "Windows bitmap           image", "Graphics Interchange Format image", "Adobe Photoshop File", "TIFF Image"}
         set audioTypesList to {"MP3 audio", "AIFF-C audio", "Waveform audio"}
         set videoTypesList to {"Video-MPEG4", "MPEG-4 File", "Video-MPEG2", "Video-MPEG", "AVI", "Matroska           Video File"}
         set fontTypesList to {"TrueType font", "PostScript® Type 1 outline font", "Font Suitcase"}
         set docsTypesList to {"Portable Document Format (PDF)", "Scrivener Project", "Microsoft Word 97 - 2004           document", "Rich Text Document", "Plain Text Document", "CSV Document", "Pages Publication"}
         set epubTypesList to {"epub", "Kindle Document", "iBooks Author Template", "iBooks Author Book"}
         set archTypesList to {"ZIP archive", "tar archive", "rar archive", "Tar Gzip Archive"}
         set diskTypesList to {"Installer package", "Disk Image"}
         set execTypesList to {"Application (32-bit)", "Application", "Unix Executable File"}
         set webTypesList to {"HTML document", "XML document"}
         set iconTypesList to {"Apple Icon Image", "Icon Container", "Windows Icon Image"}
         set otherTypesList to {"XTorrent File"}
         set uberList to imageTypesList & audioTypesList & videoTypesList & fontTypesList ¬
                                  & docsTypesList & epubTypesList & archTypesList & diskTypesList & execTypesList ¬
                & webTypesList & iconTypesList & otherTypesList
    set imagesFolder to "Technomage:Users:andyhainline:Downloads:Images" as alias
    set appsFolder to "Technomage:Users:andyhainline:Downloads:Apps" as alias
    set archivesFolder to "Technomage:Users:andyhainline:Downloads:Archives" as alias
    set epubFolder to "Technomage:Users:andyhainline:Downloads:eBooks" as alias
    set fontsFolder to "Technomage:Users:andyhainline:Downloads:Fonts" as alias
    set docsFolder to "Technomage:Users:andyhainline:Downloads:PDFs and Docs" as alias
    set diskFolder to "Technomage:Users:andyhainline:Downloads:Installers and Disk Images" as alias
    set iconFolder to "Technomage:Users:andyhainline:Downloads:Icons" as alias
    set audioFolder to "Technomage:Users:andyhainline:Downloads:Audio" as alias
    set videoFolder to "Technomage:Users:andyhainline:Downloads:Video" as alias
    set otherFolder to "Technomage:Users:andyhainline:Downloads:Torrent Files" as alias
    set miscFolder to "Technomage:Users:andyhainline:Downloads:Miscellanious" as alias
    processItems(these_items)
    end adding folder items to
    on processItems(these_items)
         tell application "System Events"
              repeat with anItem in these_items
                   if (kind of anItem) is in imageTypesList then
                       move file anItem to imagesFolder
                  else if (kind of anItem) is in audioTypesList then
                       move file anItem to audioFolder with replacing
                 else if (kind of anItem) is in videoTypesList then
                       move file anItem to videoFolder with replacing
                 else if (kind of anItem) is in fontTypesList then
                      move file anItem to fontsFolder with replacing
                 else if (kind of anItem) is in docsTypesList then
                      move file anItem to docsFolder with replacing
                else if (kind of anItem) is in epubTypesList then
                      move file anItem to epubFolder with replacing
                else if (kind of anItem) is in archTypesList then
                      move file anItem to archivesFolder with replacing
                else if (kind of anItem) is in diskTypesList then
                     move file anItem to diskFolder with replacing
                else if (kind of anItem) is in execTypesList then
                     move file anItem to appsFolder with replacing
               else if (kind of anItem) is in webTypesList then
                    move file anItem to docsFolder with replacing
               else if (kind of anItem) is in iconTypesList then
                   move file anItem to iconFolder with replacing
               else if (kind of anItem) is in otherTypesList then
                   move file anItem to otherFolder with replacing
               else if (kind of anItem) is not in uberList then
                   move file anItem to msicFolder with replacing
               else if (kind of anItem as text) is "Folder" then
           set folderFiles to get every file of anItem
           processItems(folderFiles)
      end if
      end repeat
    end tell
    end processItems

  • What does this simple folder action not work?

    OK I have been playing with this all weekend. I just wanted a simple folder action to move a file from folder a to folder b. There is really not much to it. The workflow works just fine. "Somtimes" running the script runs the workflow.app. However when I drop a file into folder a - nothing happens. I have enabled folder actions. Can anyone help?
    here is a pic of the relative screens that should help you.
    http://flickr.com/photos/hawsnet/2605303472/sizes/l/
    Thanks for any help you can provide.
    PS I even stopped by my local Genius Bar -- they could not help.

    Vantive,
    Try either:
    *on adding folder items to this_folder after receiving added_items*
    *tell application "Finder"*
    *repeat with this_item in added_items*
    *move this_item to folder "Folder B" of folder "Desktop" of folder¬*
    *"MyShortName" of folder "Users" of the startup disk*
    *end repeat*
    *end tell*
    *end adding folder items to*
    Or:
    *on adding folder items to this_folder after receiving added_items*
    *tell application "Finder"*
    *repeat with this_item in added_items*
    *move this_item to "Macintosh HD:Users:MyShortName:Desktop:Folder B"*
    *end repeat*
    *end tell*
    *end adding folder items to*
    In either case replace MyShortName with your actual short name. +Make sure the script is saved to your Home/Library/Scripts/Folder Action Scripts folder.+ Then right-click or control-click on "Folder A" and, if necessary, select "Enable Folder Actions." If enabled, right-click or control-click on "Folder A" and select "Attach a Folder Action…" When the Choose-a-File window appears highlight the script and press Choose.
    Both of the above scripts worked for me in testing. For what it's worth, both my /Library/LaunchAgents, and /System/Library/LaunchAgents folders are empty.
    Good Luck...
    Regards, Andrew99

  • How do I get folder actions to work in Mavericks?

    Please forgive the cross-posting, but I really wasn't certain which forum would likely have the answer. I have enabled folder actions, attached my workflow, etc. but I CANNOT get the script to run when I drop a file in the folder. I know the script works if I run it by itself. Please help!

    Hi All,
    I have a related question, but no solution. For quite a while now I have had two scripts which worked together very well:
    Script 1: Attached to Folder 1 -- it was written so that any folder created inside Folder 1 would have a second script (Script 2) attached to it.
    Script 2: Did several things, including copying items to a different location.
    All this was working perfectly on my iMac. Now that it has been transferred to my MacBook Air, I can't get Script 2 to stick to the newly created folder. It sticks and works fine if I manually attach it to the new folder, but not when it's attached via Script #1.
    Again, this only seems to be a problem on the MacBook Air. Never before.
    Any help would be great. Thanks so much.

  • Folder action not working outside automator

    I have a folder action to convert and move all mkv files from within the downloads folder. The folder action included (among other) the following script:
    on run {input, parameters}
              set filename to POSIX path of input
              do shell script "/usr/local/bin/mkvdts2ac3.sh -n " & quoted form of filename user name "white" password "*****)" with administrator privileges
      #do shell script "mount -t smbfs //panos:z2kdft50@nas/internal internal" user name "white" password "******)" with administrator privileges
              do shell script "mv " & quoted form of filename & " /Users/white/internal/library/" user name "white" password "****)" with administrator privileges
              do shell script "rm -rf /Users/white/Downloads/*.dts" user name "white" password "*****)" with administrator privileges
              set message to "File " & filename
              return message
    end run
    The total workflow runs perfectly from within automator.
    The problem is that when the folder action is triggered from the system (regular usage, ouside automator) the workflow executes up to the point that the applescript is implemented (I ghave installed growl notifications at various points to know how far the script has run)
    Does anybody have any idea why could this be happening?
    I  have looked around but found no answers.
    Thanks.
    <Edited by Host>

    Thanks.
    I replaced the applescript with the following shell script:
    /usr/local/bin/mkvdts2ac3.sh -n $@
    mv $@ /Users/white/internal/library/
    rm -rf /Users/white/Downloads/$@
    It works.
    I had tried a shell script in the very begining, but I could not get it to work so I resorted to Applescript instead. I felt myself too that applescript was an unnecessary complicated procedure just to run shell commands.
    Anyway, now, each time a dts download finishes, it gets transcoded to dolby digital so that it can be played on my samsung tv (it's media player does not support dts).

  • Folder Actions quit working

    I did an Archive and Install a week ago. Since then, the Folder Action scripts I had set up have ceased working. I can't get them to work any more.
    What's the solution?

    What's the solution?
    What have you tried?
    The most obvious thing is to make sure that Folder Actions are enabled.
    Open /Applications/AppleScript/Folder Actions Setup and make sure that Folder Actions are enabled, and that the folder(s) in question have scripts attached to them.

  • Folder action not working

    I can't figure out why the following folder action script does not work.  I get the alert message but when I choose 'yes' the file is not copied...am I missing something?
    Thanks.
    Pedro
    property dialog_timeout : 30 -- set the amount of time before dialogs auto-answer.
    on adding folder items to this_folder after receiving added_items
        try
            tell application "Finder"
                --get the name of the folder
                set the folder_name to the name of this_folder
            end tell
            -- find out how many new items have been placed in the folder
            set the item_count to the number of items in the added_items
            --create the alert string
            set alert_message to ("Folder Actions Alert:" & return & return) as Unicode text
            if the item_count is greater than 1 then
                set alert_message to alert_message & (the item_count as text) & " new items have "
            else
                set alert_message to alert_message & "One new item has "
            end if
            set alert_message to alert_message & "been placed in folder " & «data utxt201C» & the folder_name & «data utxt201D» & "."
            set the alert_message to (the alert_message & return & return & "Would you like to view the added items?")
            display dialog the alert_message buttons {"Yes", "No"} default button 2 with icon 1 giving up after dialog_timeout
            set the user_choice to the button returned of the result
            if user_choice is "Yes" then
                tell application "Finder"
                    activate
                    set copyFolder to "Photo [Data]:10 Multimedia:CompAlerts:"
                    set copyitem to file "MacOS:Users:Peter:Documents:CompAlert.rtf"
                    duplicate file copyitem to copyFolder with replacing--THIS DOES NOT EXECUTE
                    --go to the desktop
                    --open the folder
                    --open this_folder
                    --select the items
                    --reveal the added_items
                end tell
            end if
        end try
    end adding folder items to

    The only standout is the line:
                    duplicate file copyitem to copyFolder with replacing--THIS DOES NOT EXECUTE
    where:
                    set copyFolder to "Photo [Data]:10 Multimedia:CompAlerts:"
    In other words, copyFolder is a string. You're trying to duplicate a file to a string? Doesn't seem viable to me.
    Maybe you mean:
                    duplicate copyitem to folder copyFolder with replacing
    In other words, identify the destination as a folder rather than a string.
    If that doesn't work, remove the try/end try statements. This will let the script report any errors, rather than failing gracefully. try/end try is useful for production but supresses error messages, which makes troubleshooting harder.

  • Folder Actions will not work - tried everything

    Recently Folder Actions simply stopped working on 10.6.4. They worked fine before then recently just stopped working.
    I've tried everything I can think of, including:
    1. completely removing enabling & disabling & enabling folder actions through the setup app.
    2. trashing folder actions plist files in user domain and relaunching
    3. disabling related launchd processes with lingon
    4. trashing launch agents in user domain and also trying to unload them in terminal
    5. trying to kill the folder actions dispatcher process in activity monitor (just relaunches, as it should)
    6. emptying system caches including dyld shared cache using cocktail
    7. doing most of the above and restarting
    It's driving me nuts. Any other ideas?
    here's some entries from syslog:
    8/2/10 9:31:37 AM com.apple.launchd.peruser.501[269] (com.apple.FolderActions.folders) Throttling respawn: Will start in 6 seconds
    8/2/10 9:37:29 AM Folder Actions Setup[4403] * WARNING: Method selectedRowEnumerator in class NSTableView is deprecated. It will be removed in a future release and should no longer be used.
    8/2/10 9:43:37 AM com.apple.launchd.peruser.501[269] (com.apple.FolderActions.enabled[309]) Exited: Killed
    8/2/10 9:46:23 AM [0x0-0x3a03a].com.apple.systemevents[360] com.apple.FolderActions.enabled: Already loaded
    8/2/10 9:52:07 AM Folder Actions Setup[1083] * WARNING: Method selectedRowEnumerator in class NSTableView is deprecated. It will be removed in a future release and should no longer be used.
    8/2/10 9:52:16 AM com.apple.launchd.peruser.501[269] (com.apple.FolderActions.folders) Throttling respawn: Will start in 7 seconds
    8/2/10 9:53:02 AM com.apple.launchd.peruser.501[269] (com.apple.FolderActions.folders) Throttling respawn: Will start in 1 seconds
    8/2/10 9:56:18 AM com.apple.launchd.peruser.501[269] (com.apple.FolderActions.folders) Throttling respawn: Will start in 10 seconds
    8/2/10 10:00:58 AM Folder Actions Setup[2190] * WARNING: Method selectedRowEnumerator in class NSTableView is deprecated. It will be removed in a future release and should no longer be used.
    8/2/10 10:01:01 AM com.apple.FolderActions.enabled[2236] launchctl: Error unloading: com.apple.FolderActions.folders
    8/2/10 10:01:30 AM com.apple.launchd.peruser.501[269] (com.apple.FolderActions.folders) Throttling respawn: Will start in 10 seconds
    8/2/10 10:01:42 AM com.apple.launchd.peruser.501[269] (com.apple.FolderActions.folders) Throttling respawn: Will start in 9 seconds
    8/2/10 10:05:03 AM sudo[2622] lryter : TTY=ttys000 ; PWD=/Users/lryter ; USER=root ; COMMAND=/bin/launchctl unload -w /Users/lryter/Library/LaunchAgents/com.apple.FolderActions.enabled.plist
    8/2/10 10:10:25 AM Folder Actions Setup[676] * WARNING: Method selectedRowEnumerator in class NSTableView is deprecated. It will be removed in a future release and should no longer be used.
    8/2/10 10:10:27 AM com.apple.FolderActions.enabled[680] launchctl: Couldn't stat("/Users/lryter/Library/LaunchAgents/com.apple.FolderActions.folders.plist"): No such file or directory
    8/2/10 10:10:27 AM com.apple.FolderActions.enabled[680] nothing found to unload
    8/2/10 10:10:38 AM com.apple.launchd.peruser.501[268] (com.apple.FolderActions.folders) Throttling respawn: Will start in 8 seconds
    8/2/10 10:13:17 AM sudo[943] lryter : TTY=ttys000 ; PWD=/Users/lryter ; USER=root ; COMMAND=/bin/launchctl unload -w /Users/lryter/Library/LaunchAgents/com.apple.FolderActions.enabled.plist
    8/2/10 10:14:01 AM com.apple.launchd.peruser.501[268] (com.apple.FolderActions.folders) Throttling respawn: Will start in 4 seconds
    8/2/10 10:14:14 AM com.apple.launchd.peruser.501[268] (com.apple.FolderActions.folders) Throttling respawn: Will start in 1 seconds

    I finally go Folders Action to work, after being unable to use it even for a simple beep for years now.
    Here is what I did:
    1. Changed permissions to 755 for the following folder and two contained files (note that 775 didn't work for me)
    ~/Library/LaunchAgents/
    ~/Library/LaunchAgents/com.apple.FolderActions.enabled.plist
    ~/Library/LaunchAgents/com.apple.FolderActions.folders.plist
    2. Changed the following lines within ~/Library/LaunchAgents/com.apple.FolderActions.enabled.plist (using TextWrangler)
    from:
    <key>OnDemand</key>
    <false/>
    to:
    <key>OnDemand</key>
    <true/>
    Prior to the permissions changes within #1 above, the value of <true/> kept getting changed back to <false/> by something in the system... and though
    there was improvement by the permissions changes, the following console message appeared until false was changed to true.
    com.apple.FolderActions.enabled[4127] launchctl: Error unloading: com.apple.FolderActions.folders
    At this point true is staying true, and not being changed by unknown forces to false, and the above message is not appearing.
    3. The only other thing I did prior to #1 and #2 above, was to run the script (unsaved),
    tell application "/System/Library/CoreServices/Folder Actions Dispatcher.app" to tick
    This little tell line caused something to occur where my Folder Action surprised me and worked for the first time though it took about 30 seconds and was erratic,
    sometimes performing, sometimes not, though if I would do move something into the folder to trigger the action that should occur, and did not occur, then at the point
    running the above tell line or script would cause the action to occur.
    4. At this point I don't fool with the tell line or script from #3, and it seems that systemevents has gotten involved, as well as launchd, and with my simple Folder Action script
    I'm getting the folder action within 10 seconds compared to 30 to 45 if ever seconds.
    5. This is still too early to tell if this is the wonder pill I've needed since Leopard, and now Snow Leopard (and maybe Tiger as well: I forget when I even tried Folder Actions).
    There was a time when I moved things around, so that the items normally found in the former AppleScript folder, were placed elsewhere in subfolders, so I don't know if that lead to this...
    because I could get Folder Actions to work on Macs in the Applestore, but not my own Mac. Watching the console messages was helpful. I don't think it's a big concern that
    deprecated messages are found sometimes. That's a just a normal part of the constantly rebuilding of things that goes on. It's more like a reminder that we've got an upgraded
    OEM part were going to start using, and the older part won't be available after such and such date, so program accordingly, and in the meantime drive.

  • 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

  • Downloads Folder Action

    Hello,
    I found a simple shell script that will help keep my Downloads folder organized by modification date. I used Automator to create a Finder Plug-In that's nothing but a Run Shell Script action: touch "$." Works great. I saved it as a folder action and attached it to my Downloads folder, but it won't work as a folder action. I added a Wait for Files to Copy action (testing with a pdf extension and download), and it still doesn't work. I tried to attach it to a dummy folder on my desktop that I directed Safari to save downloads to, still wouldn't work. I've saved it as a script, and attached it to the folder as a script, no joy. Will someone please help me with this. It should be very simple, I just want the items to be touched without having to touch each one myself.
    I have checked permissions on my user folder and Downloads folder, also deleted ~/Library/LaunchAgents/com.apple.FolderActions.enabled.plist and com.apple.FolderActions.folders.plist, logged out/in, disabled and re-enabled folder actions. Also, I have another folder action attached to my Downloads (Unquarantine), and it seems to work fine.
    Thanks in advance for any help,
    Jess

    I'm closing this question because the folder actions somehow work now. I must have shut down/started up enough times, or done something inadvertently to kick it into gear. I frequently have to check to make sure the folder actions are enabled, but other than that, my script works like a charm! Thanks for giving this your attention.
    Jess

  • 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".

  • AppleScript: Set folder name of Folder Action?

    Problem:
    How to get the folder name that the running Folder Action script is attached too. Script is functional, stdin bash script with AppleScript via osascript. I just want the folder name, not the POSIX path to it. The System Events dictionary suggests this is possible. I don't want to hardcode the action's assigned folder in the bash script if I can get it dynamically from AppleScript. I know how to return it to bash. AppleScript newbie that has spent several hours googling and testing already.
    Tried:
    tell application "Finder"
         --AppleScript Editor can't get container -- no surprise. Folder action does work
         get POSIX path of (container of ((path to me) as text))
         set workingDir to quoted form of result
         display alert "Current Folder: " message workingDir as critical
    end tell
    tell application "System Events"
         activate
         --AppleScript Editor can't get name of folder action. Folder action does not work
         set currentDir to name of folder action
    end tell
    Appreciation for time and solution in advance.

    twtwtw wrote:
    In that case I suggest you make your life easier.  delete the osascript bit and just return a 0 or 1 from the shell script.  That integer will be passed on to the next action, so add an applescript action that checks to see if the input is 0 or 1 and displays a dialog if necessary:
    on run {input, parameters}
              if input as integer > 0 then
      -- error
      display alert "whatever"
              end if
    end run
    The only reason I posted in the first place was to assess if it was possible to dynamically discover the folder name of the folder action using AppleScript through an osascript request. If the bash script has to be scrapped and entirely rewritten as a Applescript action -- just to obtain the folder name, then that answers my question.
    The purpose of the osascript was to provide an OS X style, user friendly dialog that displays any martian files the bash script ignored. It was the least amount of coding for the result.
    I believe that your input example from above would take the exit status from the preceding shell script. How is my invalidFiles variable passed then? In the shell script, I can pipe the invalidFiles printf line to pbcopy to put that content on the clipboard. After the script is done, I can retrieve that information with a pbpaste command. I wonder if this information is available to your trailing AppleScript action for inclusion in the display alert statement?

  • Folder action plug in not working

    Hi,
    Using Automator I created a workflow that filters .avi files, then opens tubitunes to convert them to .m4v
    When I run a test it works perfectly, but when I save it as a plug-in to the folder and drop an item in that folder, nothing happens.
    any help will be greatly appreciated

    Be sure your folder action script is saved into your /Library/Scripts/Folder Action Scripts folder. I'm new to these things, but I have a working script which I tried to enable using the Attach Folder Action option with the script saved on my desktop and it didn't work -- moving it into that folder above made it work, but I'm still having some issues.
    For me it seems that the Enable Folder Actions keeps disabling itself. My folder action works once (mine is launching VisualHub to convert videos to mp4) but doesn't work again. Checking on the status of the folder, it reads "Enable Folder Actions" again, which means it has been disabled.
    I'm running 10.5.4 on a Mac Pro. This was updated from a fresh 10.5.1 install.

  • Folder Action works, but only once

    Attached a Folder Action to a folder in my Home directory, to upon dropping folders/files to that folder will change the Folder Views to 128 Icon size (and subfolders) - works once, then next time I drop a folder into that folder doesn't do anything.
    Here is the script attached via Automator to that folder
    on adding folder items to this_folder after receiving added_items
    tell application "Macintosh HD:Users:USERNAME:Library:Workflows:Applications:Folder Actions:MAKE 128.app"
    open added_items
    end tell
    end adding folder items to
    Is there something I'm doing wrong? Folder Actions are still Enabled for said folder but dropping into that folder does not produce these results - something happens in the menubar but that's it.
    Message was edited by: nickdynamite

    You might try this approach, using the following workflow...
    1) *Get Specified Finder Items* -- press the "+" sign, navigate to the target folder and choose it.
    2) *Set Folder Views* -- move the icon slider to 128, etc., and check "Apply Changes to Sub-folders."
    From Automator's File menu select Save As Plug-in > Plug-in for: Folder Actions.
    The AppleScript, located in the User > Library > Scripts > Folder Action Scripts folder, can then be modified:
    on adding folder items to this_folder after receiving added_items
    tell application "Macintosh HD:Users:username:Library:Workflows:Applications:Folder Actions:Make 128.app"
    run -- 'run' replaces 'open added_items'
    end tell
    end adding folder items to
    This has worked for me consistently (so far) using Mac OS 10.4.11; not tested in Leopard. Your results may vary.
    Good luck.

Maybe you are looking for

  • Error while load balancing two servers

    i have two Solaris servers running 9iAS R2 OC4j. current patch level is 9.0.2.3 i'm trying to load balance the instances according to the instructions in this document: Oracle9i Application Server: mod_oc4j Technical Overview all i should need to do

  • Can multiple articles be in one indesign document?

    I have an indesign document with multiple articles in it. I made the articles using the Articles panel. How can I add these articles to a folio? When I add an article to a folio using the folio builder panel, it adds the entire document, even though

  • Photosmart Premium not printing

    After updating drivers the 309g printer will only advance blank paper. There's no printer queue after ejecting the unprinted page. Any suggestions?

  • Custom order in playlists

    First, please accept my apologies for posting this query twice - I had posted the earlier one without realising it was on the iTunes for Windoze thread. I'm not thinking too clearly just now, so please bear with my error in netiquette. Using iTunes 7

  • Error in Oracle Lite Database connection

    Hi, I have installed the Oracle Application server 10.1.3.1.0 on my laptop (basic installation). I tried to define a database connection in the JDeveloper connection navigator to the Oracle lite database. When I test the connection I got an error: "I