Re: Netscape Communicator - new window with properties?
Re: Netscape Communicator - new window with properties?
- Subject: Re: Netscape Communicator - new window with properties?
- From: Arthur J Knapp <email@hidden>
- Date: Mon, 18 Mar 2002 11:00:16 -0500
>
Date: Sat, 16 Mar 2002 22:06:19 -0500
>
From: Rob Jorgensen <email@hidden>
>
Subject: Netscape Communicator - new window with properties?
>
Someone has asked me to write a script for Netscape Communicator but
>
I do not have Communicator installed. I wrote a suitable script for
>
Navigator, but it doesn't work in Communicator.
>
>
Problem: Client has a script which:
>
>
opens a new document (window)
>
sets the position of new window to {894, 50, 99, 0}
These coordinates do not make any sense to me.
>
opens aURL in the new window
>
>
He doesn't want to see the new windows jump from their default
>
position to the target position. So...
>
>
Is it possible to have Communicator create a new window with
>
properties {position:{894, 50, 99, 0}, URL:aURL}? If not with a URL,
>
I can work around that.
These two handlers will create the needed url:
-- Specify window bounds as { left-point, top-point, width, height }
--
on NewWindowUrl_XYWH(sUrl, sTarget, x, y, w, h)
-- Note: "void" is nessesary to prevent NN from showing "[window
-- Object]" in the calling window.
--
set sUrl to "javascript:void(open('" & sUrl & "','" & sTarget & "','"
set sUrl to sUrl & "width=" & w & ",height=" & h
set sUrl to sUrl & ",left=" & x & ",top=" & y -- MISE
set sUrl to sUrl & ",screenX=" & x & ",screenY=" & y -- NN
return sUrl & "'))"
end NewWindowUrl_XYWH
-- Specify window bounds in absolute coordinates, using:
-- { left-side, top-side, right-side, bottom-side }
--
on NewWindowUrl_LTRB(sUrl, sTarget, l, t, r, b)
-- Note: "void" is nessesary to prevent NN from showing "[window
-- Object]" in the calling window.
--
set sUrl to "javascript:void(open('" & sUrl & "','" & sTarget & "','"
set sUrl to sUrl & ",left=" & l & ",top=" & t -- MISE
set sUrl to sUrl & ",screenX=" & l & ",screenY=" & t -- NN
set sUrl to sUrl & ",width=" & (r - l) & ",height=" & (b - t)
return sUrl & "'))"
end NewWindowUrl_LTRB
NewWindowUrl_LTRB("
http://www.apple.com", "stage", 10, 10, 200, 200)
NewWindowUrl_XYWH("
http://www.apple.com", "stage", 10, 10, 200, 200)
{ Arthur J. Knapp, of <
http://www.STELLARViSIONs.com>
<
mailto:email@hidden>
try
<
http://www.VivaLaData.com/>
on error number -128
end try
}
_______________________________________________
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.