A friend and I are attempting to create an Applescript Studio version of a vanilla applescript application we developed which encodes and decodes input text using the RSA algorithm. The goal of the Applescript Studio version is to produce a more user-fiendly and professional “front-end” to all of the Unix stuff going on in the background. In addition, we are attempting to use a web-based message inbox for every user of our program. This on-line inbox will list for every received message the unencoded sender, date, and subject in a table–with the subject column as a link to the full, encoded message.
The problematic issue is working with the links in the inbox. I have managed to force Webview to launch our URL, however I have no idea how to track the user’s URL location as they navigate their inbox. What I have in mind ideally is for Applescript Studio to catch and report whenever the user opens a link, which would then be followed by:
set theMessageURL to the result as text
do shell script "curl " & theMessageURL & "> tempmessage.txt"
The program would then cat and decode the message the user selected using script I have already written for the vanilla applescript.
Below is the script already in place, which was derived in full from a post on these forums by a certain member whose name I did not jot down but to whom I owe much. Thanks to whomever it was, and my apologies for the incomplete citation.
on awake from nib theObject
global webView
if theObject's name is "browser" then
set webView to theObject
call method "stringByEvaluatingJavaScriptFromString:" of webView with parameter "location.href='http://www.serveraddress.com/'"
end if
end awake from nib
I think, based on lots of research on this topic, that I need to use some sort of “setPolicyDelegate,” however I have no idea how to implement such a method.
As for my abilities, I know some applescript, as well as Unix very well, however my Objective-C is not very good.
Many thanks for any help anyone can offer!
Model: MacBook Pro 15’’
AppleScript: 1.10.7
Browser: Safari 419.3
Operating System: Mac OS X (10.4)