Advertisement
Guest User

Untitled

a guest
Jul 7th, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. on run argv
  2.     -- last argument should be the window title
  3.     set windowtitle to item (the count of argv) of argv as text
  4.    
  5.     -- all but last argument go into CLI parameters
  6.     set cliargs to ""
  7.     repeat with arg in items 1 thru -2 of argv
  8.         set cliargs to cliargs & " " & arg as text
  9.     end repeat
  10.     tell application "iTerm"
  11.         activate
  12.         tell current window
  13.             set newTab to (create tab with default profile)
  14.             tell the current session of newTab
  15.                 set name to windowtitle
  16.                 write text cliargs
  17.             end tell
  18.         end tell
  19.     end tell
  20. end run
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement