Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Seeking a good reference/tutorial for AppleScript.?

I have a MacBook with OS 10.5 and Office 2005.

The ultimate goal is to take data from an Excel spreadsheet and have it put into a website's text field(s). (I'm using Safari).

I can handle the VBA part of it, but getting from the Clipboard to Safari is outside of Excel VBA.

I'm hoping to use AppleScript to do this. I've had limited success combining Animator and Script Editor, but a book or tutorial on Apple Script would get me there faster (and with better script.)

A help forum dedicated to Apple Script would also be useful.

Thanks in advance.

Update:

Thanks OpenSource,

The getting data into the Clipboard is no problem. VBA's DataObject.

I already have is Excel>Clipboard. I want to replace my manual "activate Safari" "paste into first box" "activte Excel" <VBA to put other data in Clipboard> "activate Safari" "paste into second box". Your reply suggests that Java is another link in the chain.

I'll check out that book.

Thanks.

1 Answer

Relevance
  • 1 decade ago
    Favorite Answer

    AppleScript, unfortunately, probably will not be able to do this, depending on your needs.

    If you know the text fields' names for your website, you could try this script:

    tell application "Safari"

    set the URL of tab 1 of window 1 to "your website's url here"

    delay 3

    do JavaScript "document.forms[0].name of text field one.value = \"" & "what you want the value to be\"" in document 1

    do JavaScript "document.forms[0].name of text field two.value = \"" & "what you want the value to be\"" in document 1

    do JavaScript "document.forms[0].submit()" in document 1

    end tell

    However, this will not do any automation outside what you put in the value spots (basically, it won't connect to the Clipboard and you'll have to insert the text box values manually). So:

    You could try to go to this website:

    http://www.apple.com/applescript/

    but it is sort of hard to navigate to the full instructions. There are several books out there, I would get "AppleScript: The Definitive Guide" by Matt Neuburg and O'Reilly Media.

    The problem is, I'm not sure if Office has any AppleScript bridges that allow the script editor to gain access to the Office clipboard. You could search "Microsoft Office AppleScripts" in google, but you might get already created stuff.

    Your best bet is to move the data into a database (preferably MySQL - this is preinstalled on MacOS10.5 - google MySQL for tutorials), and then use a server-side scripting web development framework (Ruby on Rails is preinstalled, google RoR for tutorials, you could also use Django for Python or CakePHP for PHP), to upload the information in the database to your website.

Still have questions? Get your answers by asking now.