Skip to content

Instantly share code, notes, and snippets.

@marutanm
Created October 19, 2010 13:19
Show Gist options
  • Select an option

  • Save marutanm/634170 to your computer and use it in GitHub Desktop.

Select an option

Save marutanm/634170 to your computer and use it in GitHub Desktop.
AppleScript: Share on Facebook
tell application "Safari"
if (count of every document) > 0 then
activate
do JavaScript "javascript:var d=document,f='http://www.facebook.com/share',l=d.location,e=encodeURIComponent,p='.php?src=bm&v=4&i=1287494202&u='+e(l.href)+'&t='+e(d.title);1;try{if (!/^(.*\\.)?facebook\\.[^.]*$/.test(l.host))throw(0);share_internal_bookmarklet(p)}catch(z) {a=function() {if (!window.open(f+'r'+p,'sharer','toolbar=0,status=0,resizable=1,width=626,height=436'))l.href=f+p};if (/Firefox/.test(navigator.userAgent))setTimeout(a,0);else{a()}}void(0)" in document 1
end if
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment