Re: Open URL in Safari with Post params
Re: Open URL in Safari with Post params
- Subject: Re: Open URL in Safari with Post params
- From: Emmanuel LEVY <email@hidden>
- Date: Thu, 10 Nov 2011 19:57:36 +0100
You mean, as in:
open location "https://www.somewhere.net?firstname=fred&lastname=bert" ?
Emmanuel
On Nov 10, 2011, at 6:21 PM, Simon Forster wrote:
>
> 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
_______________________________________________
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