0
votes

The Applescript results are Display "end tell"

I don't know why this is happening and need it fixed. When I click next page for the second time, it "end tell"s randomly

This is the script:

display dialog "What would you like to launch? choose wisely!" buttons
    {"Next Page", "cancel", "Google Chrome"} default button "Next Page"

if result = {button returned:"Google Chrome"} then
    tell application "Google Chrome" to activate

else if result = {button returned:"cancel"} then

else if result = {button returned:"Next Page"} then
    display dialog "Page 2" buttons {"Next page", "Mari0", "Minecraft"} default button "Next page"

    if result = {button returned:"Minecraft"} then
        tell application "Minecraft" to activate

    else if result = {button returned:"Mari0"} then
        tell application "Terminal"
            activate
            do script with command "open /Users/_________/Desktop/Mari0.app/"
            delay 1
            quit
        end tell

    else if return = {button returned:"Next page"} then
        display dialog "Page 3" buttons {"Safari", "Roblox", "Next Page"} default button "Next  Page"


        if result = {button returned:"Roblox"} then
            tell application "Google Chrome" to open location "http://www.roblox.com/home"

        else if result = {button returned:"Safari"} then
            tell application "Safari" to activate

        else if return = {button returned:"Next Page"} then
            display dialog "Final Page" buttons {"iMessages", "Applescript Folder", "Back to Start"} default button "Back to start"

            if return = {button returned:"Back to start"} then
                run script (open applications)

            else if return = {button returned:"iMessages"} then
                tell application "Messages" to activate

            else if return = {button returned:"Applescript Folder"} then
                do shell script "open /Users/__________/Desktop/Applescript/"



            end if
        end if
    end if
end if

These are the results from the script:

tell application "Script Editor"

display dialog "What would you like to launch? choose wisely!" buttons {"Next Page", "cancel", "Google Chrome"} default button "Next Page"
--> {button returned:"Next Page"}
display dialog "Page 2" buttons {"Next page", "Mari0", "Minecraft"} default button "Next page" --> {button returned:"Next page"}
End tell

1
Does it just display "end tell" or stop executing halfway through? It's unclear from the question.ivan_pozdeev

1 Answers

0
votes

Since you are running this test in Script editor you are telling Script Editor to run it. Naturally the tell block ends with end tell. The script has ended and Script Editor is done with its job.