Hacker News new | past | comments | ask | show | jobs | submit login

That sounds interesting. What sort of things do you do with AppleScript and the browser?



Nothing too crazy. I have a keyboard shortcut that grabs the URL from chrome, then passes it off to a script that interfaces with pass [0] to have a rudimentary, but secure and cross platform password manager.

[0]: http://www.zx2c4.com/projects/password-store/


Try this:

    tell application "Firefox"
       activate
               
       set pb to the clipboard
               
       tell application "System Events"
           keystroke "l" using command down
           keystroke "c" using command down
       end tell
               
       set page_url to the clipboard

       set the clipboard to pb
    end tell
It’s kind of hacked together and I haven’t tested it with rigor but until now it did its job. If you use it, please let me know if you could enhance it or whether it breaks for certain pasteboard contents.


Thanks, that worked well. I needed to add a pause between cmd-l and cmd-c though.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: