Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
Apple Computing Products:
macOS - Apps and Programs
Is it possible to launch a modal safari window with Applescript?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="gryphontech" data-source="post: 855438" data-attributes="member: 104298"><p>Hello,</p><p></p><p>I am writing a web-based app that needs to launch a modal browser window (no toolbar, no address bar, etc) from an applescript file. the pc side uses a .vbs file to do the same thing.</p><p></p><p>I can do it with applescript and "System Events" :</p><p></p><p>tell application "Safari"</p><p>activate</p><p>make new document with properties {URL:"http://IPADDRESS/default.aspx"}</p><p>do JavaScript ("self.resizeTo(500,480);") in document 1</p><p></p><p>tell application "System Events"</p><p>keystroke "B" using {command down, shift down}</p><p>keystroke "/" using command down</p><p>keystroke "|" using command down</p><p>end tell</p><p>end tell</p><p></p><p>But this affects the entire Safari application so new windows opened by the user appear the same way. I need it to only affect the window that is opened. I tried some JS "toolbar=no" type commands but it did not have any effect. I must admit my JS and AS is very basic at this point so it could have been poor syntax.. </p><p></p><p>Can any of you fine folks suggest a way to do this?</p></blockquote><p></p>
[QUOTE="gryphontech, post: 855438, member: 104298"] Hello, I am writing a web-based app that needs to launch a modal browser window (no toolbar, no address bar, etc) from an applescript file. the pc side uses a .vbs file to do the same thing. I can do it with applescript and "System Events" : tell application "Safari" activate make new document with properties {URL:"http://IPADDRESS/default.aspx"} do JavaScript ("self.resizeTo(500,480);") in document 1 tell application "System Events" keystroke "B" using {command down, shift down} keystroke "/" using command down keystroke "|" using command down end tell end tell But this affects the entire Safari application so new windows opened by the user appear the same way. I need it to only affect the window that is opened. I tried some JS "toolbar=no" type commands but it did not have any effect. I must admit my JS and AS is very basic at this point so it could have been poor syntax.. Can any of you fine folks suggest a way to do this? [/QUOTE]
Verification
Name this item. 🍎
Post reply
Forums
Apple Computing Products:
macOS - Apps and Programs
Is it possible to launch a modal safari window with Applescript?
Top