-
Notifications
You must be signed in to change notification settings - Fork 11
/
test.scrp
72 lines (62 loc) · 1.68 KB
/
test.scrp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
on run argv
set my_path to (system attribute "PWD") & "/"
set my_test to item 1 of argv
set my_done to item 2 of argv
set my_machine to item 3 of argv
set dsk to item 4 of argv
set loadcmd to item 5 of argv
set my_timeout to item 6 of argv
-- tell application "Virtual ]["
tell application "/Applications/Virtual ][/7.6/Virtual ][.app"
activate
delay 1.5
-- Close all open machines
close every machine saving no
-- Create a new (AppleIIe, AppleIIPlus, AppleII)
if my_machine = "iie" then
set theMachine to (make new AppleIIe)
end if
if my_machine = "iip" then
set theMachine to (make new AppleIIPlus)
end if
if my_machine = "ii" then
set theMachine to (make new AppleII)
end if
tell theMachine
-- Change to a color screen
-- set monochrome screen to false
set scanlines to true
set speaker volume to 0.25
if dsk = "1" then
insert my_path & my_test into device "S6D1"
end if
-- Now wait for the startup screen
delay 0.5
reset
set my_prompt to "*"
if loadcmd = "LOAD" then
set my_prompt to "]"
end if
repeat until the last line of the compact screen text = my_prompt
delay 0.5
end repeat
type line loadcmd
play my_path & "test.aif" on device "cassette recorder"
set speed to maximum
try
with timeout of my_timeout seconds
waiting until screen equals imagefile POSIX path of (my_path & my_done)
end timeout
on error
return "ERROR: TIMEOUT: Virtual ][ screen != " & my_done
end try
-- short test of image, not necessary, next 3 lines can be removed
-- delay 0.5
-- type line ""
-- delay 3
end tell
delay 1.5
close every machine saving no
quit
end tell
end run