Twice Bitten Posted August 4, 2019 Share Posted August 4, 2019 I see that using the ! command in Alfred will open a new Terminal Session. Is there a way to have Alfred pass the text into the current Terminal session window? Thanks. Link to comment
vitor Posted August 4, 2019 Share Posted August 4, 2019 41 minutes ago, Twice Bitten said: Is there a way to have Alfred pass the text into the current Terminal session window? If the Terminal in question supports doing so via AppleScript, yes by setting the custom terminal integration. To get the exact code, you may wait for someone on the forum or try Ask Different. Link to comment
GuiB Posted August 5, 2019 Share Posted August 5, 2019 @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 Twice Bitten 1 Link to comment
Twice Bitten Posted August 5, 2019 Author Share Posted August 5, 2019 Brill. The second script worked for me. Cheers GuiB! Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now