Hi, my name is Ivan, I’ve done an app with Xcode (interface builder+applescript), I’ve embedded an webview object in the IB that opens a webpage which contains links to another webpages, and when the user clicks(go) to another( for example: “Run App!”) the app must run another application in client side with the parameters in the url,
my problem is: I don’t know how to obtain the url, I’ve tried so many codes I found in google, in this website and in the apple mailing lists, but the “working” code for url obtaining I think it’s done in cocoa and I’m very new in applescript and have no idea of cocoa.
Here is my code:
(*Web browser*)
on launched theObject
loadPage from "http://localhost"
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 "Loader"
set mainFrame to call method "mainFrame" of object (view "browser")
end tell
call method "loadRequest:" of mainFrame with parameter requestWithURL
end loadPage
(*End web browser*)
My question is: How can I obtain the current URL, or the URL clicked, or something like that?
Thank You very much.