Applescript不运行用户命令

Applescript不运行用户命令,applescript,iterm,applescript-objc,Applescript,Iterm,Applescript Objc,我需要applescript运行tabset test命令来更改iTerm当前选项卡的名称 -- Launch iTerm and log into multiple servers using SSH tell application "iTerm" activate create window with default profile set newWindow to (create window with default profile) set Serve

我需要applescript运行
tabset test
命令来更改
iTerm
当前选项卡的名称

-- Launch iTerm and log into multiple servers using SSH
tell application "iTerm"
    activate
    create window with default profile
    set newWindow to (create window with default profile)
    set Servers to paragraphs of (do shell script "/bin/cat $HOME/serverlist")
    repeat with nextLine in Servers
        if length of nextLine is greater than 0 then
            tell current window
                create tab with default profile
                tell current session of newWindow

                    do shell script "export PATH='/usr/local/bin:$PATH'; tabset test "

                end tell
            end tell
        end if
    end repeat
    tell first tab of current window
        close
    end tell
    tell second window
        close
    end tell
end tell
问题是
tabset test
不起作用,并且没有任何错误提示


tabset
命令可以通过
npm安装-g iterm2选项卡集安装

Ted Wrigley是正确的。我应该使用iTerm的
write
命令在窗口中键入文本。

一般来说,AppleScript的
do shell脚本
使用默认shell运行,默认shell不会设置正常终端窗口中所需的内容的分配。当我遇到这样的问题时,我尝试的第一件事就是使用命令的完整部分:例如,
/usr/local/bin/tabtest test
,或者任何指向实用程序的正确路径。此外(回顾过去),如果您在使用iTerm,并且希望此命令在iTerm会话中运行,您不应该使用iTerm的
write
命令在窗口中键入文本吗<代码>执行shell脚本将在iTerm范围外创建后台shell。谢谢,问题已解决