Jump to content

Disable snippet placeholders with an arbitrary symbol in front of {


Recommended Posts

I have a related problem with my Markdown to BBCode workflow. I write posts on this forum in Markdown and then convert them for the forum software.

 

And every time I write a {date:…} macro or similar to show someone how to do something, Alfred expands it when I run the converter workflow (it turned that example into so I had to rewrite it).

 

The culprit in my case appears to be the Copy to Clipboard action, which is executing placeholder expansion on the contents of {query}.

 

I appreciate the utility of being able to insert dynamic placeholders into script output and have them expanded by Alfred, but an element like the Copy to Clipboard action should be configurable to put the text I pass it on the clipboard without altering it.

Edited by deanishe
Link to comment
Share on other sites

I'm definitely amenable to adding in options to prevent placeholder expansion. I'll have a think about the appropriate scope of this as I don't want to over complicate what will usually be considered as a corner case.

 

Cheers,

Andrew

Link to comment
Share on other sites

17 hours ago, deanishe said:

I have a related problem with my Markdown to BBCode workflow.

 

The way I work around it in MarkdownTransform is by copying the transformation (pbcopy) and then using {clipboard} in the Copy to Clipboard Output (for pasting, marked as transient).

Link to comment
Share on other sites

6 hours ago, vitor said:

then using {clipboard} in the Copy to Clipboard Output

 

Interesting that it’s only {query} that gets processed for placeholders.

 

6 hours ago, vitor said:

then using {clipboard} in the Copy to Clipboard Output (for pasting, marked as transient).

 

Does that actually hide it from the history (given that you used pbcopy)?

Link to comment
Share on other sites

2 hours ago, deanishe said:

Interesting that it’s only {query} that gets processed for placeholders.

 

This is down to order of operations.

 

The {query} placeholder is the first thing to be replaced out (essentially by design), and then the placeholders are processed.

 

In the framework which processes placeholders, the {date} ones are done before {clipboard}.

Link to comment
Share on other sites

8 hours ago, deanishe said:

Does that actually hide it from the history (given that you used pbcopy)?

 

It does, as long as the Copy to Clipboard acts right away. Even adding a 0.1s delay between the Run Script and the Copy to Clipboard makes it not work.

Link to comment
Share on other sites

  • 2 weeks later...

I've added an addition for the upcoming 4.1.1 from the { } button popup menu (bottom left of relevant text fields) to allow for disabling of dynamic placeholders for the current item your configuring. This works in all areas where there is the { } button, such as Workflow Copy to Clipboard, Write File, Large Type, then Remote Clipboard / Snippet, and finally the Snippets.

 

I should have a 4.1.1 pre-release out by next week :) 

Link to comment
Share on other sites

If you update to the 4.1.1 pre-release, there is now an option under the { } snippet placeholder button which allows you to disable dynamic placeholder expansion per scenario. If you update, could you let me know how you get on :) 

Link to comment
Share on other sites

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
 Share

×
×
  • Create New...