• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Open URL in Safari with Post params
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Open URL in Safari with Post params


  • Subject: Open URL in Safari with Post params
  • From: Simon Forster <email@hidden>
  • Date: Thu, 10 Nov 2011 17:21:26 +0000

Hi

Hoping someone can help me. I'd like to open a URL in Safari and submit some post params at the same time. I can achieve the end result quite easily using Safari's `do JavaScript` functionality:

tell application "Safari"
	activate
	tell window 1 to set current tab to make new tab
	do JavaScript "location = 'https://www.somwhere.net/';
	onload = function() {
		document.forms[0].item1.value = 'fred';
		document.forms[0].item2.value = 'bert';
		document.forms[0].submit();
	}" in document 1
end tell

But being an impatient blighter I find that waiting for the the first page to load is a waste of time. Why not go straight to the page I want, submitting the post parameters as I go - but I can't find the syntax.

TIA for an pointers.

Simon _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Open URL in Safari with Post params
      • From: Axel Luttgens <email@hidden>
    • Re: Open URL in Safari with Post params
      • From: Emmanuel LEVY <email@hidden>
  • Prev by Date: Re: AppleScript applications and sandboxing
  • Next by Date: As in Adobe Photoshop Elements 9
  • Previous by thread: Re: UI scripting: Problematic removal of unwanted Word footnote returns
  • Next by thread: Re: Open URL in Safari with Post params
  • Index(es):
    • Date
    • Thread