Open URL in Safari with Post params
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