0

I've made an application that I drop EPS files on and it makes two copies and renames them and transfers them to SMB shares.

But sometimes when I have more than one file selected in other windows, Finder passes multiple files onto Automator. All I really need it to use are EPS files, ignoring others and passing the EPS files on to automator for renaming.

I pass variables onto an applescript for if statements. My first attempt:

on run {input, parameters}

    if (input as text) does not contain ".eps" then
        tell application "Auto 45" to quit
    else

    end if

    return input

end run

Then I realized that this doesn't do anything about multiple files. If it finds .eps anywhere in all files combined into a single variable, it simply passes all kinds of junk files through.

I tried to use this if statement instead:

tell application finder
    if name extension of (input) is "eps" then
        #if (input as text) is equal to type "eps" then
        return input
    else
        nothing
    end if

end tell

This code doesn't work even though it compiles, nor does this solve the problem of checking multiple inputs. I'm using the Mavericks version of Automator.

1 Answer 1

0

The solution for your problem is the Filter Finder Items action.

Just add it to your workflow before your AppleScript Action.

3
  • That line compiles but I can't get it to pass the correct information back to Automator: on run {input, parameters} global myEPS set myEPS to every item of input whose name contains ".eps" return myEPS end run Commented Feb 6, 2014 at 13:22
  • I found a better way to do this, see my edit ! Commented Feb 6, 2014 at 14:19
  • BAM! That does it. Don't even need the applescript anymore. I may include it to shut down if the input is blank or to give a warning. Commented Feb 6, 2014 at 14:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .