learned Posted April 9, 2013 Share Posted April 9, 2013 Is there any way to get at the clipboard history and manipulate it in workflows? I would like to clip a bunch of urls, then have an applescript download each one. Ideally I would like to have applescript copy the most recent clipboard to the system clipboard, then delete the most recent clipboard from history. Link to comment
jdfwarrior Posted April 10, 2013 Share Posted April 10, 2013 Is there any way to get at the clipboard history and manipulate it in workflows? I would like to clip a bunch of urls, then have an applescript download each one. Ideally I would like to have applescript copy the most recent clipboard to the system clipboard, then delete the most recent clipboard from history. It's possible but not really something recommended. You could query Alfred's clipboard.alfdb in ~/Library/Application Support/Alfred 2/Databases If you query the clipboard table you could grab the most recent clipboard items. Link to comment
Andrew Posted April 10, 2013 Share Posted April 10, 2013 It's possible but not really something recommended. Ahem, definitely don't go digging around in that folder or the Alfred databases. Alfred has these open most of the time and if you mess with these while he is using them, data could get corrupt. Link to comment
theSquashSH Posted August 7, 2019 Share Posted August 7, 2019 (edited) I think you can solve that by issuing an exclusive lock on the db while modifying it: PRAGMA locking_mode = EXCLUSIVE; BEGIN EXCLUSIVE; I plan on adding that to my alfred-clipboard.sh script in the future when I implement timstamp rewriting to make the history infinite: BTW if anyone is looking for a full script example that can clone, read, merge, etc otherwise poke into the Alfred clipboard db, you can find the source for my implementation here:https://gist.github.com/pirate/6551e1c00a7c4b0c607762930e22804c Edited August 7, 2019 by theSquashSH Link to comment
deanishe Posted August 7, 2019 Share Posted August 7, 2019 7 minutes ago, theSquashSH said: I think you can solve that by issuing an exclusive lock on the db while modifying it Please don't do that. If you're going to write to the database, quit Alfred while your script is running, then restart it, instead. (And back up the database first.) If your script starts messing up people's clipboard history, the Alfred team will get the support requests. And Andrew will likely respond by changing Alfred to acquire an exclusive lock on its own databases. It's not possible to run Alfred 3 & 4 at the same time, which is a bit of a pain for workflow developers, because the Node crowd were causing problems and didn't fix them. So, please don't interfere with Alfred's functioning like that. Andrew 1 Link to comment
Andrew Posted August 7, 2019 Share Posted August 7, 2019 5 hours ago, theSquashSH said: I think you can solve that by issuing an exclusive lock on the db while modifying it Please do not exclusively lock Alfred's databases, as this will have a severe impact on Alfred's ability to operate normally. Cheers, Andrew Link to comment
dfay Posted November 28, 2019 Share Posted November 28, 2019 Is there any chance Alfred could be set to dump the clipboard contents in json somewhere as well? I’d love to be able to pull them in from Dropbox in an ios shortcut. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now