Automator variable problem

Discussion in 'Mac Programming' started by alex_a, Jan 27, 2017.

  1. alex_a macrumors newbie

    alex_a

    Joined:
    Jan 27, 2017
    Location:
    Spain
    #1
    I've created an automator app to rename files in a folder (separate parts of the filename are changed using search and replace) - three renames are fixed, but the final one I wanted to use a variable. So the script:

    1) asks for the text and saves it to a variable
    2) does rename 1
    3) does rename 2
    4) does rename 3
    5) does rename 4 using the variable

    If I use only steps 1-4 it works great, but including step 5 makes the whole app not do anything. I included display steps to show the variable and make sure it was saved correctly and it is. So I don't understand why it's not working.

    Greatly appreciate your help to solve this!
     

    Attached Files:

  2. kryten2 macrumors 6502a

    Joined:
    Mar 17, 2012
    Location:
    Belgium
    #2
    You can always create a workflow and give it some files to process. See if you get the results you expected in the Results section of every action.
    1. Get selected/specified Finder Items
    2. Do your stuff
    3. If everything works then remove step 1 and turn into application
     
  3. alex_a thread starter macrumors newbie

    alex_a

    Joined:
    Jan 27, 2017
    Location:
    Spain
    #3
    Seems the error was not adding a specific 'open folder' step. I thought I could just drag a folder onto the app which I had done with a previous version of the script (not using variable). having added that step, I now have to execute the app and tell it which folder to process, but it works fine.
     

Share This Page