With timeout of
With timeout of
- Subject: With timeout of
- From: email@hidden
- Date: Thu, 14 Dec 2000 14:17:11 EST
sorry for taking so long to reply.
Thanx to everyone for their suggestions, but this still doesnt work. This is
the latest draft, it is a script that organises scenario editors for a game
so they can be accessed and it needs to keep the choose from list dialog in
the backgroundwell one of the other apps is being worked on:
on run
set theplug to choose file of type "Opof" with prompt "Choose the plug-in
to open:"
edit(theplug)
end run
on open theplug
set theplug to theplug as alias
if folder of (info for theplug) is false then
if file type of (info for theplug) is "abcd" then
edit(theplug)
else
display dialog "That is not a plug-in." buttons "Quit" default
button 1
end if
else
display dialog "That is a folder, not a plug-in." buttons "Quit"
default button 1
end if
end open
on edit(theplug)
try
set mpath to path to me as text
set AppleScript's text item delimiters to ":"
tell mpath to if it ends with ":" then set mpath to text 1 thru -2
tell mpath to set {AppleScript's text item delimiters, mpath} to
{"", (rest of text items 1 thru -2 of (":" & it) & "") as string}
set mpath to mpath & "
Data:"
set theApp to "Ships"
set thehelp to "Dkqt"
set theList to {}
tell application "Finder"
if exists alias (mpath & "Apps:app1") then
set the end of theList to "Ships"
end if
if exists alias (mpath & "Apps:app2") then
set the end of theList to "Missions"
end if
if exists alias (mpath & "Apps:app3") then
set the end of theList to "Universe"
end if
if exists alias (mpath & "Apps:Resedit") then
set the end of theList to "Other"
end if
if exists alias (mpath & "Apps:app5") then
set the end of theList to "Calculate ID's"
end if
if exists alias (mpath & "sections:") then
set the end of theList to "Help"
end if
if exists alias (mpath & "Apps:app6") then
set the end of theList to "Check Plug"
end if
end tell
set the end of theList to "Go to Finder"
repeat
set theApp to (choose from list theList with prompt ""
default items {theApp} cancel button name "Quit") as text
if theApp is "Ships" then
tell application "Finder" to open theplug using alias (
mpath & "Apps:app1")
else if theApp is "Missions" then
tell application "Finder" to open theplug using alias (
mpath & "Apps:app2")
else if theApp is "Universe" then
tell application "Finder" to open theplug using alias (
mpath & "Apps:app3")
else if theApp is "Other" then
tell application "Finder" to open theplug using alias (
mpath & "Apps:Resedit")
else if theApp is "Calculate ID's" then
tell application "Finder" to open alias (mpath & "
Apps:app5")
else if theApp is "Help" then
set thehelp to (choose from list (list folder (mpath & "
Sections")) with prompt "Choose the resource to get help on:" default items {
thehelp} cancel button name "Back") as text
if thehelp is not "false" then
try
tell application "Finder" to open alias (mpath & "
Sections:" & thehelp)
on error
tell me to display dialog "That section is not
installed." buttons "OK" default button 1
end try
else
set thehelp to "Dkqt"
end if
else if theApp is "Check Plug" then
tell application "Finder" to open alias (mpath & "
Apps:app6")
else if theApp is "Go to Finder" then
tell application "Finder" to activate
else if theApp is "false" then
exit repeat
end if
end repeat
on error theerr number theenum
display dialog "An error has occurred." buttons {"Description
", "Quit"} default button 2
if the button returned of the result is "Description" then
display dialog "#" & theenum & return & return & theerr
buttons "Quit" default button 1
end if
end try
end edit