2

I've added a service through Automator, which opens iTerm2 in the current folder.

enter image description here

It works when I click in service menu. However when I try to assign a shortcut for it, it won't trigger.

enter image description here

Tried plenty of combinations, none of them works

Any ideas?

Attached the script:

on run {input, parameters}
    tell application "Finder"
        set dir_path to quoted form of (POSIX path of (input as alias))
    end tell
    CD_to(dir_path)
end run

on CD_to(theDir)
    tell application "iTerm"
        activate

        try
            set t to the last terminal
        on error
            set t to (make new terminal)
        end try

        tell t
            launch session "Default Session"
            tell the last session
                write text "cd " & theDir & ";clear;"
            end tell
        end tell
    end tell
end CD_to

You must log in to answer this question.

Browse other questions tagged .