Jump to content

Clipboard History recognize per app and manipulate text


snowy

Recommended Posts

The ability to recognize which app something is being copied from and perform regex or match of certain string. It then could allow you  to trigger a workflow from. or manipulate the text.

 

Example OneNote if you copy a link for workbook, section, page, etc... it can include two forms of the same link in the same copy event:

https://whatever.you.arelinking.uuidorsomething
onenote:https://whatever.you.arelinking.uuidorsomething

 

I care about the second string. I want to paste in my to do app. So the second link I need to convert to:

onenote://https://whatever.you.arelinking.uuidorsomething

this allows it to direct link to the native app at the specified location in onenote.

 

It could also be solved presumably when you go to paste it. it would match the "onenote:" and modify the string on output. or maybe there is another way to do it that is implied?

Link to comment
Share on other sites

43 minutes ago, snowy said:

it can include two forms of the same link in the same copy event


This is the heart of the issue: clipboard types. Clipboard managers only save a limited number of (standard) types because the clipboard history would become ridiculously large if they stored all representations.

 

It’s technically possible to declare custom types you’re interested in, but I wouldn’t hold out much hope for an implementation, as there’s huge foot-gun potential (e.g. someone adds their audio editor’s clipboard type and then blames Alfred for having a 50GB clipboard history).

Link to comment
Share on other sites

  • 3 weeks later...

I was thinking more along the lines of inverse of how ignore option works. I am just  taking stab that Alfred uses NSworkspace.shared activeApplication. Hence, why the note in the clipboard manager will ignore only "focusable" apps. As it is only way to tell which application is "active" or "focused". 

 

My thought was if you had list of triggerable apps. If this is the "focused" or active application when copying to the pasteboard it can be trigger in a workflow.

 

Link to comment
Share on other sites

In your particular case, you could set up your own Hotkey or Snippet Trigger that converts the clipboard contents to your onenote:// link format and then pastes it.

 

1 hour ago, snowy said:

If this is the "focused" or active application when copying to the pasteboard it can be trigger in a workflow.

 

To do what?

 

An "on clipboard change" trigger sounds pretty borderline. Alfred's strict about not running stuff unless the user explicitly triggers it.

Link to comment
Share on other sites

I messed a little with the snippet trigger. i haven't gotten to work I wanted. I might try some more, but I still think there is value in the functionality.

 

I wouldn't say borderline other clipboard managers (like Alfred offering clipboard history and workflows):

 

https://docs.copied.app/#/mac/preferences?id=rules

 

Copied.app allows for something like this:

 

Quote

Application rules

Application rules apply to clippings copied while the specified application is the active foreground app.

 

Regular Expressions

Regular expression rules lets you use regular expressions to match copied text or more complex URLs. Like host name rules, a list or text formatter has to be specified when creating a regular expression rule.

 

 

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
×
×
  • Create New...