Wrapping a bookmarklet into AppleScript
  • This is not a FastScripts-specific question, but I found an interesting example of using FastScripts at ( http://www.red-sweater.com/blog/293/really-simple-discovery ).

    I wonder what's need to make a bookmarklet into an AppleScript.

    I think I need to something like:
    tell application \"Safari\"
    do JavaScript \"blahblahblah\" in document 1
    end tell

    I just tossed a bookmarklet code minus the very first "javascript:" in blahblahblah.
    I'm obviously missing something. Tried several tweaks, but didn't work.

    Can you give me a little tutoral for me?
  • Hi Takaaki - I wonder if it will be instructive for you to take a look at the "Safari Next Page" script that I wrote:

    http://www.red-sweater.com/AppleScript/

    It uses a huge JavaScript in the context of the frontmost Safari window.

    Daniel
  • Thanks, it seems that I had a problem with URL encoding like "%20".
  • Daniel Jalkut said:
    … take a look at the "Safari Next Page" script that I wrote

    Unfortunately that script's not working with Google search pages after the recent updates and I haven't been able to figure out how to fix it. Any help is appreciated - thanks!
  • Sorry to hear it's not working so well anymore with Google. I am pretty busy right now with MarsEdit 3 related fixes, so I won't be able to give it a look very soon, but I'm adding it to my TODO list. In the mean time if anybody else figures out what needs to be done to fix it, that would be great.

    I should move all the scripts up to an open source hosting platform like bitbucket or github, at some point.

    Daniel
  • Thanks for the response. If only I wasn't so clueless how to debug and possibly fix this [type of] problem.

    I've been postponing updating to Snow Leopard, though MarsEdit 3 was added to my list of reasons to do it.
Start a New Discussion

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!