Jump to content

Info from Clipboard not being passed to Terminal when using {clipboard}


Recommended Posts

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
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.

Link to comment
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
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 by deanishe
Link to comment
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.

 

SUZ9CPb.png

 

Edited by vitor
Link to comment

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...