I gotta admit, I've been struggling with the AppleScript 1.1 basic command set. There's not even a "delay" command. Because of the limitations, I had to use a text-only web browser to download the page contents first. We could probably implement this in a separate baby Perl program, but for now it's WannaBe 68k.
Here is my proto-script! For now, it is not automatic, and requires you to choose the path of the saved file in a "Save As" dialog box:
set filespec to (new file default name "test.txt")
tell application "WannaBe 68k" to fetchurl "http://10.0.0.76:80/test.html" to filespec
open for access filespec
set testvar to (read filespec)
close access filespec
if testvar contains "testing!wow" then beep
(The bbcode "code" function seems to be totally broken??? Lol.)
Basic rundown of stuff:
- 10.0.0.76 is my IIS server right next to the System 7.6.1 machine.
- "test.html" is a test file containing the string "testing!wow" which Applescript looks for.
- The "beep" command can be changed to "tell application "Finder" shut down". It's "beep" for testing purposes.
- There's probably a way to set the filepath automatically, and get rid of the dialog box.
Now, with all that said, maybe simple File Sharing would be easier to implement. You could basically get rid of all the web parsing schmuck (removing the need for a Perl program/web browser and an http server) and check a file directly with the "open for access" commands.
Here is my proto-script! For now, it is not automatic, and requires you to choose the path of the saved file in a "Save As" dialog box:
set filespec to (new file default name "test.txt")
tell application "WannaBe 68k" to fetchurl "http://10.0.0.76:80/test.html" to filespec
open for access filespec
set testvar to (read filespec)
close access filespec
if testvar contains "testing!wow" then beep
(The bbcode "code" function seems to be totally broken??? Lol.)
Basic rundown of stuff:
- 10.0.0.76 is my IIS server right next to the System 7.6.1 machine.
- "test.html" is a test file containing the string "testing!wow" which Applescript looks for.
- The "beep" command can be changed to "tell application "Finder" shut down". It's "beep" for testing purposes.
- There's probably a way to set the filepath automatically, and get rid of the dialog box.
Now, with all that said, maybe simple File Sharing would be easier to implement. You could basically get rid of all the web parsing schmuck (removing the need for a Perl program/web browser and an http server) and check a file directly with the "open for access" commands.