Is this possible to have "paste" as trigger?


is it possible to trigger some action when "paste" happens (either via CMD-V or context menu)? My use case is that when I'm pasting some link to specific app, I'd like to paste it transformed.

How I solved it for now is to have CMD-V keyboard shortcut for that app defined like this:

It works fine but I'd also like it to work when I paste it via mouse's context menu.

If you don't mind, I would also ask some clipboard related questions:

  1. Is it possible to use clipboard contents in advanced conditions or in "If Condition" action similar to "BTTActiveWindowTitle" etc? It would be nicer for me to have such conditions there instead of doing it in Transformer Function itself
  2. I'm probably not understanding "Use Apple Default Or Do Nothing" action, I thought having it instead of "Paste text" in my example above would finish the flow by pasting the clipboard automatically because it would use whatever CMD-V's default action is :slight_smile:

Thanks to the author of the great app!

This is not possible. BTT can trigger after you copy something, but not before you paste something.
(E.g. see Paste clean links from clipboard - #6 by Andreas_Hegenberg )

Making the clipboard content available as an advanced trigger condition is a good idea. I think I can add that with one of the next versions.

For most trigger types the "Use Apple Default Or Do Nothing" will do nothing. It won't help you with this. However if you want you can send the cmd+v shortcut at the end of your action sequence instead of using the paste text action.

1 Like

All clear, would be nice but I use mouse "paste" very very rarely so it was just a out of curiosity.

Very much appreciated!

I see, thanks! I actually changed it now to this because I didn't want to change the original contents of the clipboard but only for this "paste":

Works fine but noticed that when I paste it in given app 2 times quickly then the transformed version is stored in clipboard so if I want to paste the original version to other app, I need to copy it again or from clipboard manager (no real issue, just saying).

BTW not sure why but the text in the editor of Insert/Type/Paste Custom Text always has white colour on white background so it's invisible (I had to change colour to black).

Thanks again very much for help and answers.

Now I found an issue with my setup from previous post because I can't paste file/screenshot/video from clipboard now, any idea how to work around it? Some if/else, probably having clipboard content as variable as mentioned before (with additional clipboard type variable?) for conditions would solve this?

Or transformer function async (clipboardContentString) could receive the type as additional argument? I'm not sure if it's possible to somehow distinguish between data type right now to use either that or async (clipboardContentData).

This is a known limitation, currently BTT doesn't care about the data type. I don't think there is a good workaround.
However I plan to add an option that will allow to specify the paste type for groups or content formats.

For now I'd recommend to use the standard paste as default and define a separate shortcut that uses the "Paste specific items from clipboard manager action" to paste in plaintext

Thanks, I will probably do that as a workaround until what you plan will be implemented :slight_smile:

I can just use what I already have just with different shortcut, right? I'm not sure how "Paste specific items from clipboard manager" would help me here. Basically CMD-V would be default system paste and CMD-ALT-V or whatever would be my transformation paste which would basically do nothing if clipboard contents is not text.

But since clipboard manager seems to know if the content is image or binary file or text (because it providers different available actions for each item), would adding type of current/latest clipboard item as another variable to be used in scripts or conditions difficult or not possible?