Sridhar Katakam Posted April 3, 2013 Share Posted April 3, 2013 I am looking for a workflow that would invoke the Add to Delicious bookmarklet whose code is here via a keyword in Alfred. The way the bookmarklet works is: You select any text (optional) that should be in the 'Your Comment' text area and click on the bookmarklet in the bookmarks bar. It opens up a popup like this: We can edit the description, fill in tags (auto suggesting) and add the link. Thanks in advance. Link to comment
Sridhar Katakam Posted April 3, 2013 Author Share Posted April 3, 2013 I got it. osascript: tell application "Google Chrome" execute front window's active tab javascript "javascript:(function(e,t){var n=e.document;setTimeout(function(){function a(e){if(e.data==='destroy_bookmarklet'){var r=n.getElementById(t);if(r){n.body.removeChild(r);r=null}}}var t='DELI_bookmarklet_iframe',r=n.getElementById(t);if(r){return}var i='https://delicious.com/save?',s=n.createElement('iframe');s.id=t;s.src=i+'url='+encodeURIComponent(e.location.href)+'&title='+encodeURIComponent(n.title)+'¬e='+encodeURIComponent(''+(e.getSelection?e.getSelection():n.getSelection?n.getSelection():n.selection.createRange().text))+'&v=1.1';s.style.position='fixed';s.style.top='0';s.style.left='0';s.style.height='100%';s.style.width='100%';s.style.zIndex='16777270';s.style.border='none';s.style.visibility='hidden';s.onload=function(){this.style.visibility='visible'};n.body.appendChild(s);var o=e.addEventListener?'addEventListener':'attachEvent';var u=o=='attachEvent'?'onmessage':'message';e[o](u,a,false)},1)})(window)" end tell 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