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:
"Stockly, Ed" <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Fri, 22 May 2009 13:50:08 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (59 lines)
>>> The vMac emulator is a very simple Mac Plus emulator which does not share
disks directly

I'm still using classic for HyperCard, which means no intel. I've heard
there are newer, better MacOS emulators that run on the newer processors but
I haven't looked for or tried them.

It may be worth looking for something more fexible.

In the meantime...

> if line 1 of it is "hscript" then delecte line 1 of it
> do it as Applescript  (or, "open URL it", etc)

In Hypercard the value of "it" changes frequently (like the AppleScript
result variable) so I'd try the following instead:

on mouseUp
  put the clipboard into myVar
  if line 1 of myVar is "hScript" then
    delete line 1 of myVar
    do  myVar as appleScript
  end if
end mouseUp

> I just need an Applescript idle script that does basically the same thing with
the clipboard every few seconds.

As Mark suggested, place the following script in a stay-open applet. It will
check the clipboard every 5 seconds.


my CheckClipBoard()

on CheckClipBoard()
    set myVar to the clipboard
    set oldDelims to AppleScript's text item delimiters
    set AppleScript's text item delimiters to return
    if text item 1 of myVar is "hscript" then
        set myVar to text items 2 thru -1 of myVar as text
    end if
    set AppleScript's text item delimiters to oldDelims
    run script myVar
end CheckClipBoard

on idle
    my CheckClipBoard()
    return 5
end idle

This is what I was using in the clipboard to test this:

hScript
display dialog "Worked"

HTH,

ES

ATOM RSS1 RSS2