Standard Finishing
Xerox4Over

Announcement

Collapse
No announcement yet.

Apple Automator Mavens?

Collapse
Canon
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Apple Automator Mavens?

    I seem to have a love/hate relationship with Apple Automator.

    Some things work as intended, nice and easy.

    Other things that should be easy either don’t work as intended or I am missing something that should be “obvious”.

    Is anybody out there proficient with Automator?

    For example, I often take screen captures, however they are tagged with my monitor profile which is large. I would like to automate converting to sRGB using a folder action set to my desktop. The issue is that no matter what combination of settings I use to get finder items or filter finder items based on file name, file type, extension etc. the Automator action will try to convert files that don’t match the filter rules.


    Stephen Marsh
    Comments are personal and my views may not be shared by my employer or partners.

  • #2
    Bump… Anybody?

    I can provide examples.

    Is it me? Is it Mac OS 10.9.5?


    Stephen Marsh
    Comments are personal and my views may not be shared by my employer or partners.

    Comment


    • #3
      I've found folder actions to be pretty unreliable. I can take a look at your scripts to see if I see an error but I had to stick with straight applescript and a program a friend wrote to monitor the folders.

      Comment


      • #4
        Originally posted by Mikie View Post
        I've found folder actions to be pretty unreliable. I can take a look at your scripts to see if I see an error but I had to stick with straight applescript and a program a friend wrote to monitor the folders.
        Thank you for the reply Mikie!

        Folder Action example:

        Filter Finder Items:All/Name/Contains/18000
        New Text File…
        New Mail Message

        The goal is that if the watched folder has a new file added that is titled “filename_18000.jpg”, then an email should be created with a new text file. If a file such as “filename_00001.jpg” is added, a new email should NOT be generated (as 00001 is not 18000). However if a file name contains say 00001, the folder action is triggered when this does not match 18000. My understanding is that the Filter Finder Items should only pass on a file if the name contains 18000 for example. It could be ANY file added to the folder, even a file without a number in it’s filename that triggers the automator workflow.

        So, is it possible that a Folder Action will simply process any files input into the folder, irrespective of the conditions put in place to limit the processing? Is my expectation wrong that I should be able to use a “filter finder items” to limit the processing? Same goes for “get finder items” or “find finder items” when used in a Folder Action.


        Stephen Marsh
        Last edited by Stephen Marsh; 12-28-2015, 05:20 PM.
        Comments are personal and my views may not be shared by my employer or partners.

        Comment


        • #5
          Automator doesn't work that way in my experience, you will have to have an applescript to filter the name conditions because automator is a workflow, there is no IF/THEN logic. It does look like it should work when viewing it in automator, but nope it's just a simple workflow handler. Step one: Filter names. Step two: create text. Step three: email. It does all of that, but like I said there is no IF/THEN so it jsut goes through the steps.

          You may have better luck on the apple forum though, I gave up on folder actions a few years ago. Applescript and extenscript for me, sometimes I even write applescript INSIDE of extendscript

          sorry I couldn't be of more assistance.

          Comment


          • #6
            Thanks again for the reply Mikie. I guess this explains the mixed results with Folder Actions vs. say Services etc.

            I have spent a few days trawling the internet for AppleScript or Shell Script code for use as a conditional if/else filter without any luck. The search continues…


            Stephen Marsh
            Comments are personal and my views may not be shared by my employer or partners.

            Comment


            • #7
              Hello Stephen,

              In my experience Mikie is quite correct.

              If you really want to avoid the applescript route you can create IF/THEN routines by passing files to other folders that have Automator folder actions for the next stage of the workflow. It's clunky and slow but it can work.
              Last edited by Tim-Ellis; 01-03-2016, 10:33 AM.

              Comment


              • #8
                Originally posted by Tim-Ellis View Post
                Hello Stephen,

                In my experience Mikie is quite correct.

                If you really want to avoid the applescript route you can create IF/THEN routines by passing files to other folders that have Automator folder actions for the next stage of the workflow. It's clunky and slow but it can work.


                Mikie Mikie

                Thanks Tim, I did try that, however the goal was:

                * Automated, hands free with no operator intervention

                * If a file is found in a folder with 18000 in the filename, trigger an email (but don’t trigger an email if any other number is found in a file name).

                I could not get this to work chaining two folders together, as each time the folder action would stump me.

                It is not that I wish to avoid using an AppleScript or Shell Script – it is just that I can’t write one and I cant find any available code to work as a conditional if/then filter.

                I did find and install something that sounded promising, an Automator action created by a third party “Stop If Input is Empty”, however it either does not work with later OS versions or I used it incorrectly.

                This is not a big deal, it is more of a challenge than anything!


                Stephen Marsh
                Comments are personal and my views may not be shared by my employer or partners.

                Comment


                • #9


                  Hello Stephen,

                  ​Hey, thanks to you I found the "create_CMYK_scatter.app"

                  The least I can do is return the favour for all the time that thing has saved me. :-)


                  You can add a "Run Applescript" action in Automator.


                  on run {input, parameters}

                  if ((input) as string) does not contain "18000" then


                  -- do nothing and quit

                  display dialog "I quit" -- remove this line after testing

                  quit

                  end if
                  return input
                  end run



                  You should be able to copy and paste this text into the Automator Applescript Action.

                  It will replicate the “Stop If Input is Empty” action.

                  Save your work often as every time you test your workflow
                  Automator will try to Exit as you hit the "Quit" command.

                  Keep the display dialog for as long as you can so Automator does not quit when you are not ready.


                  The workflow will carry on running as long as
                  input contains "18000"

                  The
                  screen shot attached shows my test app.

                  Any problems, just let me know.
                  Attached Files
                  Last edited by Tim-Ellis; 01-03-2016, 11:29 AM.

                  Comment


                  • #10
                    Thank you Tim, no problems – it worked beautifully, just as Apple should have done out of the box! :]

                    P.S. I don’t recall the topic thread or post that lead to you finding the “create_CMYK_scatter.app”, however I am glad to have helped in the past!


                    Stephen Marsh
                    Last edited by Stephen Marsh; 01-03-2016, 06:14 PM.
                    Comments are personal and my views may not be shared by my employer or partners.

                    Comment


                    • #11
                      Dwight Kelly at Apago.
                      Matt Beals
                      The views expressed here are my own personal views and are not those of my employer.

                      Comment

                      KBAAvantiSmartsoft (Presswise)DuploXerox4OverCanon

                      Zero Setup Time

                      Collapse

                      Zero Setup Time:
                      Myth Or Reality?

                      As the twenty-first century opened, Koenig & Bauer had already anticipated the need for the coexistence of conventional and digital printing, and had begun to develop the technology that is today empowering offset printers to meet those challenges.

                      Read the Article.

                      Smartsoft (Presswise)AvantiKBAXerox " "DuploCanon4Over

                      What's Going On

                      Collapse

                      There are currently 9164 users online. 84 members and 9080 guests.

                      Most users ever online was 14,674 at 05:29 AM on 10-30-2019.

                      Working...
                      X