python - Value from browser to commandline -


i'm looking pass values browser bookmarklet command-line (os x). simplest way this?

assuming bookmarklet sets value in 'window', it's possible use os x yosemite's "script editor" , javascript language , pass value along commandline.

// activate script hotkey // ...  function valuetocli(input){      var cli = new application("terminal");     cli.activate();      // run shellscript or whatever...     cli.doscript("echo " + input) }  // init (function (){      var safari = new application("safari");     safari.activate();      // json custom obj: window.cttr      var browservalue = safari.dojavascript('json.stringify(window.cttr)', {         in: safari.windows[0].tabs[0]     });      // send values along...     valuetocli(browservalue);  })(); 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -