[an error occurred while processing this directive]
[url] rasterweb.net/raster/
[email] pete@rasterweb.net
[pgp key] public key

RasterWeb [More Info]
Home
About
Contact
Archives
Search
Mobile Edition
Kids
Misc
Rambles
Computers
Code

Code:
Code contains bits of text that are probably more interesting to computers than people...


[RasterWeb]

Here's the code use to make an AppleScript droplet call a MacPerl script. Since MacPerl isn't multithreaded, this lets the AppleScript act as a sort of 'cron' agent...

Here's our AppleScript. Save it as an 'Application' with 'Stay Open' and 'Never Show Startup Screen' selected.


on idle
	tell application "MacPerl"
		Do Script "Mac HD:myperlscript.pl"
		return (10 * minutes)
	end tell
end idle

The script 'myperlscript.pl' can do anything you want. It will run every 10 minutes. We can change this by changing the AppleScript Application. And, of course, you can change it to run only once, or at certain times, or all that other jazz. I'm not a big AppleScript freak, but I found this snippet kinda useful (not as useful as a threaded MacPerl would be, of course!)

You can also embed a MacPerl script right into your AppleScript, or vise versa... See Chris Nandor's work in this area for more info.



[top of page]

  Last Modified: 08.17.2000 by rasterboy