Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Applescript?

  • 10-04-2006 10:46am
    #1
    Closed Accounts Posts: 27,857 ✭✭✭✭


    Hey folks,

    I got an iBook about 2 months ago, and I just noticed a bit of mention about AppleScript, here and there.

    Just wondering what's it all about... Is it worth learning? Can the same stuff be done with some other language? Is it difficult?

    What kind of things can one do with it? (sell it to me :p)

    I'll take a look at applescripter.com too and see what it has to say

    Thanks!


Comments

  • Closed Accounts Posts: 98 ✭✭pa


    DaveMcG wrote:
    Hey folks,

    I got an iBook about 2 months ago, and I just noticed a bit of mention about AppleScript, here and there.

    Just wondering what's it all about... Is it worth learning? Can the same stuff be done with some other language? Is it difficult?

    What kind of things can one do with it? (sell it to me :p)

    I'll take a look at applescripter.com too and see what it has to say

    Thanks!

    Applescript is an English-like language that is used to control and automate Mac applications. It is very easy to use, and very powerful. To give you an idea what it looks like and what it does, take a look at this simple script: (You can write and run scripts using the Script Editor app that came with your Mac)

    tell application "Safari"
    activate
    set doc to the front document
    set the URL of doc to "http://www.apple.com"
    set zoomed of the front window to true
    delay 10
    set myText to the source of the front document
    quit
    end tell


    tell application "BBEdit 6.5"
    activate
    set the text of the front window to myText
    format the front window mode hierarchical
    balance tags
    set finishedText to the text of the front window
    quit
    end tell


    tell application "Finder"
    set outputFile to "Macintosh HD:Users:pa:Desktop:output.html"
    set output to (open for access file outputFile with write permission)
    write finishedText to output
    close access output
    end tell

    This will open a specified web page in Safari, get the HTML source for it, load it in BBEdit, format it, balance the tags, and save it to a file on the desktop.

    To see the sort of functionality any app makes available to Applescript programming, take a look at its dictionary using the "Open Dictionary" command in Script Editor's File menu.


Advertisement