JA_UK Posted August 4, 2021 Share Posted August 4, 2021 Hi, I am making a workflow where the most recent thing (a URL) stored within the clipboard history should be passed into Terminal using the Terminal Command action. I have tried to use {clipboard}, {clipboard:0}, {clipboard:1} etc in the Terminal Command action to pull the URL from the clipboard at that point, before the command is passed to Terminal. What I am finding, when Terminal opens, is that '{clipboard}' is literally what has been passed to Terminal, rather than the URL I'm aiming for from the clipboard history. This, of course, leads to Terminal doing not what I was intending. What is strange is that if I pass the same thing to a Large Type action (rather than to a Terminal Command action), then the correct URL from the clipboard appears on-screen. Grateful for any suggestions. Thanks. Link to comment
deanishe Posted August 4, 2021 Share Posted August 4, 2021 2 minutes ago, JA_UK said: What is strange is that if I pass the same thing to a Large Type action (rather than to a Terminal Command action), then the correct URL from the clipboard appears on-screen. Macro expansion other than {query} doesn’t work in any Command or Script boxes. Anywhere you’d insert code or commands to be run, basically. Insert an Arg & Vars utility before your Terminal Command and compose the command in there, then just put {query} in the Terminal Command. JA_UK 1 Link to comment
JA_UK Posted August 4, 2021 Author Share Posted August 4, 2021 Excellent....thanks once again for your advice! Link to comment
JA_UK Posted August 4, 2021 Author Share Posted August 4, 2021 2 hours ago, deanishe said: Macro expansion other than {query} doesn’t work in any Command or Script boxes. Anywhere you’d insert code or commands to be run, basically. Is there a reason for that, just out of interest? Thanks. Link to comment
deanishe Posted August 5, 2021 Share Posted August 5, 2021 (edited) 12 hours ago, JA_UK said: Is there a reason for that, just out of interest? In the general case, it’s because passing command-line arguments and environment variables to an external script is a much better way to run code than pasting it in a textbox and running text macros on it ({query} is only supported for backwards compatibility). In this particular case (Terminal Command), it's perhaps an oversight because command-line arguments and environment variables aren't available in a Terminal Command. Edited August 5, 2021 by deanishe Link to comment
JA_UK Posted August 7, 2021 Author Share Posted August 7, 2021 How do I show this thread as 'solved'? Thanks! Link to comment
vitor Posted August 7, 2021 Share Posted August 7, 2021 (edited) 2 hours ago, JA_UK said: How do I show this thread as 'solved'? I’ve done it for you. For future reference, you add a solved tag and set it as the item prefix. Edited August 7, 2021 by vitor 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