user1825922
user1825922

Reputation: 35

Automator service in OSX High Sierra

Automator service at the active finder window. The idea is to create a folder template at the active finder window with choosing the new folder dialog. Service:enter image description here

  1. ask for folder name
  2. make new folder
  3. run shell script

The Automator service fails and I am not sure why. The path of the active finder window is not reaching the variable thePath which is assigned to the new folder Automator action.

The screen shots displays a simplified version of the service and the error. Can I get idea of what is wrong?

enter image description here

Upvotes: 0

Views: 300

Answers (1)

wch1zpink
wch1zpink

Reputation: 3142

Try inserting this code in a run AppleScript action, into your workflow.

set theName to text returned of (display dialog ¬
    "INSERT A NEW FOLDER NAME" default answer ¬
    "Enter Desired Name Of New Folder" hidden answer false ¬
    buttons {"Cancel", "OK"} ¬
    default button ¬
    "OK" cancel button ¬
    "Cancel" with title ¬
    "CHOOSE A NAME" with icon 1 ¬
    giving up after 30)

tell application "Finder"
    set currentTarget to target of window 1 as alias
    set the name of (make new folder at currentTarget) to theName
end tell

enter image description here

Upvotes: 1

Related Questions