9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Jack Johnson <knapjack@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] webscript
Date: Fri,  7 Oct 2005 19:03:01 -0700	[thread overview]
Message-ID: <6e35c0620510071903x512c9536n4c43f14570ffeb99@mail.gmail.com> (raw)
In-Reply-To: <43465F0E.6080104@golubovsky.org>

On 10/7/05, Dimitry Golubovsky <dimitry@golubovsky.org> wrote:
> Russ Cox wrote:
> > I would like to be able to write scripts like this:
> >
> >       load "http://www.fedex.com/Tracking"
> >       find form
> >       enter "792544024753"
> >       submit

Looks a whole lot like AppleScript:

using terms from application "Address Book"
	on action property
		return "address"
	end action property
	
	on action title for thePerson with theAddress
		return "Im Stadtplandienst zeigen"
	end action title
	
	on should enable action for thePerson with theAddress
		return true
	end should enable action
	
	on perform action for thePerson with theAddress
		tell application "Address Book"
			set z to zip of theAddress
			set c to city of theAddress
			set s to street of theAddress
		end tell
		tell application "Safari"
			set browser to make new document
			tell browser
				set URL to "http://www.stadtplandienst.de/"
			end tell
			delay 2 -- give Safari a little time to load the page
			do JavaScript "document.forms[0].elements[\"plz\"].value = \"" & z
& "\";" in document 1
			do JavaScript "document.forms[0].elements[\"city\"].value = \"" & c
& "\";" in document 1
			do JavaScript "document.forms[0].elements[\"str\"].value = \"" & s
& "\";" in document 1
			do JavaScript "document.forms[0].submit()" in document 1
		end tell
		return true
	end perform action
end using terms from

(courtesy http://rsvp.atsites.de/discuss/msgReader$236 )

-Jack


  reply	other threads:[~2005-10-08  2:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-07  7:01 Russ Cox
2005-10-07 11:31 ` Eric Van Hensbergen
2005-10-07 19:09   ` lucio
2005-10-07 11:42 ` Dimitry Golubovsky
2005-10-08  2:03   ` Jack Johnson [this message]
2005-10-07 17:06 ` Bakul Shah
2005-10-07 18:11   ` Skip Tavakkolian
2005-10-07 20:11     ` erik quanstrom
2005-12-17 21:26 ` Caerwyn Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6e35c0620510071903x512c9536n4c43f14570ffeb99@mail.gmail.com \
    --to=knapjack@gmail.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).