Opening a script with a script

applescriptscript

I am using a script and I have a secret code to input within the script (If that makes sense) after I input the code, it is supposed to open the script within the application, the main.scpt. I don't know how to do that considering that I am an amateur so I thought I should ask the pros. How do I open a script that's inside the application's packaged contents using applescript

here is the script im tryna use. I feel like Im being stupid. It may help to know that I am trying to open the same script in the application Im running. I made a secret message to use in a textbox to open the script to edit it, but it says Apple Event Timed out. Can I run an application and open the script at the same time? Swipe to the left of the code to see the whole thing. Here it is-

if mainReturned = "∆" then -- Special keyword that opens the script
    display dialog "Keyword '" & mainReturned & "' is being executed." buttons {"OK"} default button 1 with title "Maccist Auto-Web" with icon file "Macintosh HD:Users:<Insert User>:Documents:robot-icon.png" giving up after 1
    open file "Macintosh HD:Users:<Insert User>:Desktop:<Insert Name of Application>:Contents:Resources:Scripts:main.scpt"
    with timeout of 600 seconds
    end timeout
end if

Best Answer

From within an Applescript, the command:

run script "SecondAppleScript.scpt"

will run SecondAppleScript.scpt