Hello Macrumor members, I'm new to the whole Applescript scene and i need a bit of urgent help with my popup window/dialogue/screen.
What I want to do is get my user to select Alpha or Beta or Gamma or Omega or Theta and each option corresponds to a specific Microsoft Word document. Right now, the whole thing runs (or compiles) if I save it as an application. It opens the desired M$ Word document, but with a big issue.
If i run "Beta" and close it and then later if I open "Gamma", "Beta" would appear again (as well as Gamma which will open on top). I need to know how I can prevent that past "history" thingy (opening an old document at the same time) from happening.
Please help guys! thx in advance. :thx:
Here's a copy of my code:
What I want to do is get my user to select Alpha or Beta or Gamma or Omega or Theta and each option corresponds to a specific Microsoft Word document. Right now, the whole thing runs (or compiles) if I save it as an application. It opens the desired M$ Word document, but with a big issue.
If i run "Beta" and close it and then later if I open "Gamma", "Beta" would appear again (as well as Gamma which will open on top). I need to know how I can prevent that past "history" thingy (opening an old document at the same time) from happening.
Please help guys! thx in advance. :thx:
Here's a copy of my code:
Code:
set receipt to choose from list {"Alpha", "Beta", "Gamma", "Omega", "Theta"} with prompt "Greek me?" OK button name "Holla" cancel button name "Doh!"
if receipt is {"Alpha"} then say "Tens"
if receipt is {"Alpha"} then set filepath to POSIX path of "Macintosh HD:Users:dee:Documents:Receipts:Tens.docx"
try
set command to "open " & quoted form of filepath
do shell script command
end try
if receipt is {"Alpha"} then quit
if receipt is {"Beta"} then say "Hundreds"
if receipt is {"Beta"} then set filepath to POSIX path of "Macintosh HD:Users:dee:Documents:Receipts:Hundreds.docx"
try
set command to "open " & quoted form of filepath
do shell script command
end try
if receipt is {"Beta"} then quit
if receipt is {"Gamma"} then say "Thousands"
if receipt is {"Gamma"} then set filepath to POSIX path of "Macintosh HD:Users:dee:Documents:Receipts:Thousands.docx"
try
set command to "open " & quoted form of filepath
do shell script command
end try
if receipt is {"Gamma"} then quit
if receipt is {"Omega"} then say "Millions"
if receipt is {"Omega"} then set filepath to POSIX path of "Macintosh HD:Users:dee:Documents:Receipts:Millions.docx"
try
set command to "open " & quoted form of filepath
do shell script command
end try
if receipt is {"Omega"} then quit
if receipt is {"Theta"} then set filepath to POSIX path of "Macintosh HD:Users:dee:Documents:Receipts:Billions.docx"
try
set command to "open " & quoted form of filepath
do shell script command
end try
if receipt is {"Theta"} then quit