MACSCRPT Archives

May 2009

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Lively <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Fri, 22 May 2009 16:48:55 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (36 lines)
On May 22, 2009, at 4:23 PM, Marc Bossiere wrote:
> In Hypertalk I'd write an idle script as follows:
>
> get the clipboard
> if line 1 of it is "hscript" then delecte line 1 of it
> do it as Applescript  (or, "open URL it", etc)

> I just need an Applescript idle script that does basically the same  
> thing with the clipboard
> every few seconds.
>
Since AppleScript it a beefed up Hypertalk you are actually mighty  
close.

on idle
	set clipData to the clipboard
	if paragraph 1 of clipData is "hscript" then open location (paragraph  
2 of clipData as URL)
	if paragraph 1 of clipData is "ascript" then run script (paragraph 2  
of clipData)
	return 1
end

tested using the following data sets

hscript
http://www.accuweather.com

ascript
display dialog "W00T!!"

Remember to save it as a stay open application.

-Mark
Who has written applescripts that dynamically load themselves.

ATOM RSS1 RSS2