Standard Finishing
Xerox

Announcement

Collapse
No announcement yet.

Apple Automator + Multiple Variables?

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

  • Apple Automator + Multiple Variables?

    Using Automator, I can run a shell script (bin/bash) as arguments and have a single text variable dialog box appear to be populated by ONE input value.

    I have attached a screenshot.

    Is it possible to enter in multiple inputs, perhaps separated by a comma? Example:

    Keyword 1, Keyword 2, Keyword 3 etc?

    How I currently have things setup, if I enter comma separated values a single keyword is created that reads:

    Keyword 1, Keyword 2, Keyword 3

    However, there should be three separate, individual keywords applied:

    Keyword 1
    Keyword 2
    Keyword 3

    I was hoping to avoid hard-coding in multiple variables, as it would vary, one image may only need a single entry, while another image could use more or less variables.


    Thanks in advance,

    Stephen Marsh
    Attached Files
    Last edited by Stephen Marsh; 07-26-2016, 08:16 AM.
    Comments are personal and my views may not be shared by my employer or partners.

  • #2
    Hello Stephen,

    ​I think that this is do-able but Automator lacks the "if /then" logic to handle the variety of multiple input strings for this task.

    I think you will need to add some AppleScript into the Automator Workflow to manipulate the input strings so that they suit your bash script.

    The only other way round this would be to create a looping Automator Workflow which writes the input strings to individual text files. When you exit that Workflow then you automatically trigger a second Workflow that uses a filter to select the text files and then manipulate the contents to create the bash script.

    You still require some AppleScript to do this, but not as much. The cleanest way is to use AppleScript but maybe you could prepare your input strings in a text file or excel file instead of using the.input text box?

    It has been a long day, so I do hope that makes some sense to you.

    Cheers

    Tim

    Comment


    • #3
      Thanks Tim, this is not a big deal, just looking to tighten things up a bit if at all possible. I was happy enough to work out how to turn ExifTool CLI commands into Services for the GUI, then I thought, hey – how about adding a variable. That worked great with some experimentation. So I then I thought – how about multiple inputs? This is as far as I could take things with my limited knowledge.


      Stephen Marsh
      Last edited by Stephen Marsh; 08-02-2016, 02:21 AM.
      Comments are personal and my views may not be shared by my employer or partners.

      Comment


      • #4
        The answer was “easy” in the end, I was trying too hard to do this via automator, when it appears that ExifTool already has the ability to split an input string that uses comma separator! Same end result, different approach!

        So all I needed to do was add a simple -sep , -sep ', ' switch at the end of my existing command line code and ExifTool will automatically split a comma separated keyword input string into multiple, separate keywords.

        So, “keyword 1,keyword 2, keyword 3 etc” will appear as separate keywords, rather than as a single string:

        keyword 1
        keyword 2
        keyword 3



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

        Comment


        • #5
          Hey....well that worked out well in the end. I will have to check out the ExifTool and see what it offers. Thanks for posting the outcome.

          Comment


          • #6
            Originally posted by Tim-Ellis View Post
            Hey....well that worked out well in the end. I will have to check out the ExifTool and see what it offers. Thanks for posting the outcome.
            The question is – what does’nt it offer!


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

            Comment

            CanonKBAAvantiSmartsoft (Presswise)DuploEnfocusXerox

            Free Download

            Collapse

            Trade Show Survey=
            Instant October Trade Show Survey
            Come On! Only 5 Questions

            PRINT 19 and PRINTING United are squaring off in October.
            Will you be at one of them?
            Both? Neither?
            Please take our 1-Minute survey to tell us about your plans for the two big fall shows!

            Take The Survey.

            CanonSmartsoft (Presswise)AvantiGraph ExpoKBAAvantiEnfocusGraph ExpoDuploXerox

            What's Going On

            Collapse

            There are currently 3829 users online. 74 members and 3755 guests.

            Most users ever online was 6,855 at 12:33 PM on 06-06-2019.

            Working...
            X