Jump to content
vitor

AlfredBookmarklet — Use a browser bookmarklet via Alfred

Recommended Posts

Update.

 

Added some Alfred 3 specific details (Workflow Version and About this Workflow).

Edited by vitor

Share this post


Link to post

Update:

  • It now auto-detects your frontmost browser, and acts on it.
  • Added support for Safari Technology Preview.
  • New icon.
  • Updated instructions.


To update, download the latest version (same URL).
 

Share this post


Link to post

Update.


Code is now pasted in an Arg and Vars. I figure that’ll be less intimidating that pasting it together with other code, where mistakes are easier to happen. Also added a note on Safari and variants.


To update, download the latest version (same URL) or wait a few days (15 or less) and it’ll prompt you to on next usage, since it uses OneUpdater.

Share this post


Link to post

This is such a great workflow, vitor. Thanks for making such great stuff. I'm now using it for Slicereader. A couple of years ago I wasn't able to get it to work, but the updated workflow makes it magically work. Now, when I want to read an article online, all I have to do is trigger Alfred, type 'read', then Slicereader opens and I can concentrate and read. Now I just wish Slicereader imported GIFs in addition to text/images. 

Share this post


Link to post

Yeah I read your explanation about that, sorry if I sounded obnoxious. And you are right, that's what I'm mostly interested. But if we ditch the "read from browser" thing, maybe an easier way to add bookmarklets and be sure they stick somewhere between updates/reinstalls?

Edit: Also, just a way to search for them without entering a specific keyword/trigger, just a global search.

Edited by limacohen
Added feature requests

Share this post


Link to post
1 hour ago, limacohen said:

And you are right, that's what I'm mostly interested.

 

Then I don’t intend to build that into the Workflow, for the reasons described earlier. The code is open, however, so you’re free to do so.

 

1 hour ago, limacohen said:

maybe an easier way to add bookmarklets

 

How? I’m open to that, but if I’d already though of an easier way to do it I’d have already done it (unless the drawbacks were bigger).

 

1 hour ago, limacohen said:

and be sure they stick somewhere between updates/reinstalls?

 

I’m not sure what you’re talking about. I have multiple bookmarklets built this way and they’ve always came with me through clean reinstalls of the whole system. They’re synced like every other Workflow.

 

1 hour ago, limacohen said:

Also, just a way to search for them without entering a specific keyword/trigger, just a global search.

 

Alfred doesn’t provide such global search. And the way you’re describing it there’d need to be multiple bookmarklets in the same Workflow, interacting with one of the filters Alfred provides. Seeing as bookmarklets are user-added, there’s no way I could build that into the Workflow, as I can’t predict what users will add. That method would make adding to the Workflow harder, not easier, with extra steps.

 

Looks to me like what you want is fundamentally different from this Workflow. The part you like about it is that it runs bookmarklets, and that’s easy to replicate if you extract the code. But the other part — how it’s built to call said bookmarklets — is so alien to the way it’s currently constructed it’s a whole different Workflow.

Share this post


Link to post

Yeah it's probably radically different. What I meant by "global search" would be indeed just a filter to look up within the already added bookmarklets, but as it stands now I understand how that can't be accomplished. I was hoping you could see something I could be missing. Guess I'll give it a try and work something from ~scratch~, probably reuse (and credit) some of your code to actually send the JS to the browser. Thank you again for this workflow and taking your time answering (:

Share this post


Link to post

Are we talking about Safari here?

 

I have a workflow for Safari that handles bookmarks amongst other  things. It understands bookmarklets, although I haven’t implemented the front-end yet.

Share this post


Link to post
7 minutes ago, deanishe said:

Are we talking about Safari here?

 

I have a workflow for Safari that handles bookmarks amongst other  things. It understands bookmarklets, although I haven’t implemented the front-end yet.

 

Chrome in my case (actually Vivaldi but same thing).

Share this post


Link to post

@limacohen Welcome to the forum. Could you please fill in your Powerpack email address in your forum profile? This is only visible to admins and allows us to confirm your Powerpack status, as you're asking Powerpack-specific questions. :)

 

Cheers,
Vero

Share this post


Link to post
4 hours ago, Vero said:

@limacohen Welcome to the forum. Could you please fill in your Powerpack email address in your forum profile? This is only visible to admins and allows us to confirm your Powerpack status, as you're asking Powerpack-specific questions. :)

 

Cheers,
Vero

 

Hi! Done. Sorry I missed that guideline.

 

Cheers!

Share this post


Link to post

I have found this workflow very useful. For example:

In github commit the edited file:      document.getElementById('submit-file').click();. 

 

I am totally unfamiliar with javascript, Is there also an option to  "EDIT" the file in github?

 

If so what would be the command?

 

Help is highly appreciated.

 

 

P.S. Where can I find some commands like: document.getElementById('submit-file').click();.  online ?

These commands are new to me.

Share this post


Link to post
19 hours ago, Bhishan said:

Is there also an option to  "EDIT" the file in github?

 

That will be more complex.

 

19 hours ago, Bhishan said:

P.S. Where can I find some commands like: document.getElementById('submit-file').click();.  online ?

 

By learning about JavaScript and the DOM. Those aren’t pre-built commands, you need to learn what they mean to build something custom. Unfortunately, that falls way out of scope. Stack Overflow is the appropriate place for this kind of question, but don’t mention Alfred or this Workflow, as that will only breed confusion. Ask of it like building a browser bookmarklet (“How to make browser bookmarklet to edit file in Github”).

Share this post


Link to post

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