-
Notifications
You must be signed in to change notification settings - Fork 5
/
test.scrp
47 lines (41 loc) · 1.21 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
on run argv
set my_path to (system attribute "PWD") & "/"
set my_disk to item 1 of argv
set my_done1 to item 2 of argv
set my_done2 to item 3 of argv
set my_timeout1 to item 4 of argv
set my_timeout2 to item 5 of argv
tell application "Virtual ]["
activate
-- may need delay for this error: execution error: Virtual ][ got an error: Connection is invalid. (-609)
delay 1.5
-- Close all open machines
close every machine saving no
-- Create a new (AppleIIe)
set theMachine to (make new AppleIIe)
tell theMachine
-- Change to a color screen
set monochrome screen to false
set scanlines to true
set speaker volume to 0.25
insert my_path & my_disk into device "S6D1"
try
with timeout of my_timeout1 seconds
waiting until screen equals imagefile POSIX path of (my_path & my_done1)
end timeout
on error
return "ERROR: TIMEOUT: Virtual ][ screen != " & my_done1
end try
try
with timeout of my_timeout2 seconds
waiting until screen equals imagefile POSIX path of (my_path & my_done2)
end timeout
on error
return "ERROR: TIMEOUT: Virtual ][ screen != " & my_done2
end try
end tell
delay 0.5
close every machine saving no
quit
end tell
end run