Re: Java Code in Applescript to access login boxes in Safari.
Re: Java Code in Applescript to access login boxes in Safari.
- Subject: Re: Java Code in Applescript to access login boxes in Safari.
- From: Gary Lists <email@hidden>
- Date: Tue, 27 May 2003 21:25:44 -0400
On or about 5/27/03 2:04 PM, Vic Piercy wrote:
>
Does anyone know the JavaScript Code (DO JAVASCRIPT) for accessing the login
>
boxes of a Web page?
>
>
I use a forum every day and I want to write an Applscript that will load the
>
forum web page and login with my username and password. I use Safari as my
>
Web browser. I have tried but I have been unsuccessful with getting the
>
proper Java code. Thanks in advance! Vic Piercy
See Andy O's next post...
There is no "method" for opening a "log in" box in javascript.
The dialog box that asks Username and PW (and usually shows the security
realm) is from the browser, in reply to a server response that the resource
directory is secure. That's a bit different than being a javascript method.
It doesn't matter however, because you don't need it for this task. [1]
The best way is Andy O's suggestion to add it to the query string, and then
send that along to the target of the actual log-in click.
Make sense? To get that properly formatted URL, do a log-in and you'll see
the N-V pairs needed. The session ID (if you're using those to manage user
sessions in the forum...is it PHP?) will be added.
This is the same process I use to log on to my PhpBB forums as either my
moderator account or my user account or the admin account.
One script, one click. I have an AppleScript that I keep in my IE toolbar.
Click it, get my dialogs for user/pw (these are AS 'dialog' boxes), then
form the URL with logon query string, then Open URL with the fully formed
URI+query to log on via the browser.
--
Gary
[1] Keep in mind that you _can_ mimic the alert box produced by a secured
web resource by using JavaScript. With "prompt()" (IIRC), which is just
like "display dialog default answer". Check the js man for info on the
class of the result variable -- if the dialog isn't on the right side of a
variable assignment then the user input (button and text entered) is
returned as 'result' (check it out for sure) (i.e. 'the result' holds the
result in AppleScript or you can set (assign) the whole display dialog to a
variable and then reference that.)
('the result' is a bit like 'it' in HyperTalk. Subsequent actions destroy
it, obviously, as needed, so get the values right away if you will need them
later.)
Incoming replies are auto-deleted.
Please post directly to the list or newsgroup.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.