Jump to content

[SOLVED] Enter text into Current Terminal Window?


Recommended Posts

@Twice Bitten, since you are not mentioning which Terminal application you are using, I guess you use Terminal.app. So, to "pass the text into the current Temrinal session window" and keeping your default Terminal integration as it is in Alfred (so you can keep your other action to open a new Terminal Session if you want), you can create a workflow that pass your text to a Run Script object with the script language set to /usr/bin/osascript (AS) and with the script set to:

 

on run argv
  tell application "Terminal"
    activate -- comment this line if you don't want to send the Terminal window to front
    do script (item 1 of argv) in tab 1 of window 1
  end tell
end run

or if you want to change Alfred's Terminal integration as mentioned by @vitor and use , you can set Alfred to use a Custom terminal application and set the script to :

 

on alfred_script(q)
  tell application "Terminal"
    activate -- comment this line if you don't want to send the Terminal window to front
    do script q in tab 1 of window 1
  end tell
end alfred_script

 

Link to comment
  • vitor changed the title to [SOLVED] Enter text into Current Terminal Window?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...