Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
1Password / Javascript Bookmarklet / URL Scheme / Workflow Help...
-
Hey Folks,
I'm having a hard time figuring out my workflow, here. My goal is this:
- Visit any webpage (specifically those with 'www.' subdomain)
- Hit javascript bookmarklet
- Bookmarklet sends domain name to Editorial, which strips 'www.' from domain
- Some of my 1p website fields do not have the 'www.' in them, and won't be found (i.e. 'www.google.com' does not pull up 'google.com')
- Editorial sends stripped text to 1p as search.
Here's what I have so far.
###Bookmarklet
javascript:window.location='editorial://?command=1pSearch&input='+window.location.hostname
The command runs, but it just runs the command on an empty input, it seems. That is, 1p launches with a blank search.
###1pSearch Workflow
Here's the link to my workflow.
Any help is appreciated!
-
I think it would probably be easier to strip the www. within the JavaScript of the bookmarklet, you don't really need Editorial for that.
-
Ah, took me some time to figure out how to script that with JS, but you're right, it works better that way. If anybody is interested, here's my bookmarklet:
javascript:text=window.location.hostname;if(/www\./.test(text)){text=text.replace(/www\./,"");window.location='onepassword://search/'+text;}else{window.location='onepassword://search/'+text;}
Thanks for the quick response, Ole!