Espionage724 Posted July 18, 2008 Share Posted July 18, 2008 I want to make a simple window with a web browser in it that can only display 1 webpage I tell it to exactly like the Runescape Client on Runescape's website. Is this possible? Link to comment Share on other sites More sharing options...
rollcage Posted July 18, 2008 Share Posted July 18, 2008 I want to make a simple window with a web browser in it that can only display 1 webpage I tell it to exactly like the Runescape Client on Runescape's website. Is this possible? You could do basically the same thing in Safari 4 by saving a page as a web application, and no coding required! Link to comment Share on other sites More sharing options...
Espionage724 Posted July 18, 2008 Author Share Posted July 18, 2008 Wow...i'll have to definitely try that out lol Just did it, very nice feature indeed Link to comment Share on other sites More sharing options...
~pcwiz Posted July 25, 2008 Share Posted July 25, 2008 Yeah, its really easy to do using Xcode. Just use the Web View object in Interface Builder and using a bit of code you can set it to whatever web page you like Link to comment Share on other sites More sharing options...
alloutmacstoday Posted July 25, 2008 Share Posted July 25, 2008 It's not as easy as pcwiz says, but if you look in the developer documentation for WebView, you can get it :censored2: Link to comment Share on other sites More sharing options...
~pcwiz Posted July 25, 2008 Share Posted July 25, 2008 It really is quite easy to do with AppleScript Studio, don't know about Cocoa though. Pretty simple, make an empty AppleScript studio project, open the NIB with Interface Builder, drag in a web view, name it and associate it with your main AppleScript, then open the Application AppleScript attributes and find the Application >> launched attribute, tick the checkbox, save the NIB then open your AppleScript and put this code in: on launched loadPage from "http://the-site-you-want-to-open.com" end launched on loadPage from theURL set URLWithString to call method "URLWithString:" of class "NSURL" with parameter theURL set requestWithURL to call method "requestWithURL:" of class "NSURLRequest" with parameter URLWithString tell window "-whatever your window name is--" set mainFrame to call method "mainFrame" of object (view "--whatever your web view name is--") end tell call method "loadRequest:" of mainFrame with parameter requestWithURL end loadPage Link to comment Share on other sites More sharing options...
stroke Posted July 26, 2008 Share Posted July 26, 2008 NSURLRequest *urlRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://website.com"]]; [webView loadRequest:urlRequest]; Link to comment Share on other sites More sharing options...
alloutmacstoday Posted July 26, 2008 Share Posted July 26, 2008 NSURLRequest *urlRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://website.com"]]; [webView loadRequest:urlRequest]; Yeah, that's how I'd do it! Obj-c is much better to do thigs in that AS S Link to comment Share on other sites More sharing options...
~pcwiz Posted July 26, 2008 Share Posted July 26, 2008 Cocoa is better obviously, but we all have to start somewhere right? Link to comment Share on other sites More sharing options...
Colonel Posted July 26, 2008 Share Posted July 26, 2008 Cocoa is better obviously, but we all have to start somewhere right? C# ftw... *waits for flamewar* Link to comment Share on other sites More sharing options...
skyhighmac Posted August 2, 2008 Share Posted August 2, 2008 I wrote my app in applescript too. It is powerful for controlling other apps. I can do stuff in applescript, that MAMP (written in cocoa) cant do! True, applescript isn't a programming language per-se, but it is pretty powerful People can use what they wan.t Its personal preference. Link to comment Share on other sites More sharing options...
Espionage724 Posted August 3, 2008 Author Share Posted August 3, 2008 Ok just got Xcode and I;m quite confused on where to start. How do I make a Apple Script Studio thing? Link to comment Share on other sites More sharing options...
skyhighmac Posted August 3, 2008 Share Posted August 3, 2008 File > New Project, then click "AppleScript Application" under "Application" and click next & finish the wizard. Thats how you create a project, then open up MainMenu.nib and that opens up interface builder (which does just as its name implies). Then start scripting in (yourappname).applescript. To add new scripts, right click in your project, click on "New File" and then AppleScript Text File, and make sure it is added to your target (your main app in this case) Link to comment Share on other sites More sharing options...
Mebster Posted August 16, 2008 Share Posted August 16, 2008 I'm sure by now you guys have expressed your views on AppleScript clearly enough. So now this argument needs to stop. Link to comment Share on other sites More sharing options...
Recommended Posts