on testAppleScript put "message from appleScript" end testAppleScriptopen the appleScript Script Editor and type and run this script:
tell application "SuperCard 4.1.2" do script "testAppleScript" end tellswitch to SC and you will find message from appleScript in the message box.
Create a button in your SuperCard project and give it this script: on mouseUp answer "Message from appleScript" end mouseUpback in the appleScript Script Editor:
tell application "SuperCard 4.1.2" do script "send mouseUp to cd btn 1" end tellObviously you can run a lot more complex script that these, but this should get you started.
tell application "SuperCard 4.1.2" evaluate "describe(this proj,wds)" end tellgives this:
"Wind 1 Big Test 100 Wind 2 101 Wind 3 102 Wind 4 myPalette 103"We can write a custom function in SuperCard:
function testAs theString return "you said:"&& thestring end testAsand pass it values from appleScript:
set quote to ASCII character 34
set x to "testAS(" & quote & "dance and skylark" & quote & ")"
tell application "SuperCard 4.1.2"
evaluate x
end tell
This get round sending quotes to SuperCard in a crude way, I'd like to know a better one, but my appleScript knowledge is not extensive.
This of course returns "you said: dance and skylark" to AppleScript.
Back to the How To index