How to open iTerm2 version 3 in Forklift

خرید بک لینک

I am looking for a solution which can open iTerm2 version 3 as the default terminal. For iTerm2 version 2 there were multiple AppleScripts on the inteet which worked well for opening the current Forklift dir in an iTerm tab. One such example (source):

on splitPath(path)
    -- save delimiters to restore them later
    set _delimiters to AppleScript's text item delimiters
    set AppleScript's text item delimiters to "/"
    set _array to every text item of path
    set AppleScript's text item delimiters to _delimiters
    retu _array
end splitPath

tell application "iTerm"
    activate
    -- split the specified path into its components
    set _array to my splitPath("_forklift_path_placeholder_")
    -- uncomment next line if you want to use the last component as tab name
    -- set _child to the last item of _array
    -- and then comment the next three lines
    set _nr to the count of _array
    set _lastButOne to _nr - 1
    set _child to the item _lastButOne of _array

    select first window

    tell current window
        set newTab to (create tab with default profile)
    end tell

    tell current session of first window
        -- name to the trailing component of the parent directory
        set name to _child
        write text "cd _forklift_path_placeholder_"
    end tell
end tell

In iTerm3 this no longer works, as the scripting changed slightly. I also don't know any possible way to debug what is wrong, as

  1. I cannot run the applescript file in standalone, as it depends on ForkLift variables.
  2. I don't see any place where ForkLift would log it's output. In Console at least I didn't find it.

Recent Questions...

ما را در سایت Recent Questions دنبال می‌کنید

برچسب: نویسنده: استخدام کار بازدید: 283 تاريخ: سه شنبه 15 تير 1395 ساعت: 19:48

صفحه بندی