Jump to content

Trigger a workflow whenever clipboard changes?


Recommended Posts

Hi There,

 

I'm looking for solutions that'll let me trigger a workflow when the clipboard changes.  Any ideas? If there's not an easy way to do this, I'm open to exploring a harder way to do this like a little external program that triggers the Alfred workflow.  

 

Specifically, I want to perform a text transformation on the clipboard text, and update the clipboard to contain the transformed text. For full context here I want to replace the "dl?=0" at the end of Dropbox shared link urls to "?raw=1" so that my links actually link directly to the raw content, and don't have Dropbox chrome around them.  I have this set up right now to trigger on a keyboard command but would love to change things so that my workflow just triggers everytime the clipboard changes.  If the clipboard ever has "?dl=0" in it, I'll swap it out and change the clipboard data.

 

Any ideas? I have a crapper solution for this working with a Python script but since I work on multiple computers and already have all my Alfred settings syncing between them, would love to solve this just with Alfred.

Link to comment
32 minutes ago, brobbles said:

If there's not an easy way to do this, I'm open to exploring a harder way to do this like a little external program that triggers the Alfred workflow.

 

By design, Alfred Workflows need to be deliberately called. But they’re easy to trigger from another process, via AppleScript.


That said, since the action you want to perform is so simple, you might as well do everything in the script that detects clipboard changes, when you get that working. I’d ask on Ask Different.

Link to comment
  • 9 months later...

Hi brobbles,

 

Did you ever get this working? I'd love to have the exact same workflow, this would finally make sharing my pictures on forums directly from the Finder so super easy... Way too many steps involved to do it manually, drives me nuts....

 

Cheers,
Lukas

Link to comment
54 minutes ago, vitor said:

 

That’s not what @brobbles was asking about. For your situation, won’t WebScreenshot work? You can upload images directly from the Finder to imgur.

 

 

Thanks for the reply. If I do what bobbles asked, I have the direct link to the photo that is already hosted on my Dropbox anyway, so it would be very easy to post the link into forum posts and just add the URL wrapper. Should even be easy to add that with another workflow, or even integrate it in the first workflow, I would assume? I'm definitely not a workflow expert though...

 

Do you know anybody that can set something like that up for me? I'll send you a PM.


Cheers,
Lukas

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