Jump to content
knowsnothing

Disable snippet placeholders with an arbitrary symbol in front of {

Recommended Posts

I'm making a snippet for Roam Research that involves their {{date}} command. However, when the snippet pastes {{date}} it inserts today's date. I'd like it to stop doing that. 
 

It could be just as easy as adding an arbitrary symbol in front of {

Share this post


Link to post
Share on other sites
Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
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).

Share this post


Link to post
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)?

Share this post


Link to post
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}.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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 :) 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...