Jump to content

Is there a way to make this kind of application in xcode?


14 posts in this topic

Recommended Posts

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

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

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. :D

Link to comment
Share on other sites

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

  • 2 weeks later...
 Share

×
×
  • Create New...