Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8553049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:33:38+00:00 2026-06-11T14:33:38+00:00

I’ve got a script than on login, ask a user if they want to

  • 0

I’ve got a script than on login, ask a user if they want to watch a movie. For the most part it works great. However on occasion and for reasons unknown to me I get an AppleEvent handler failed error. I’ve read other post on this error but they all seem to be unique. So, if possible can someone please take a look at my script and tell me why this occasionally pops up and if there’s anything i can do to prevent it?

One thing that might help to know, is the one thing in the script that fails when this error occurs is the movie doesn’t play. It opens in quicktime but doesn’t start.

Thanks in advance, here’s the script.

tell application "Welcome" to activate
set question to display dialog "Would you like a welcome video?" buttons {"No, I've seen it", "Yes, please"} default button 2
set answer to button returned of question
if answer is equal to "Yes, please" then tell application "QuickTime Player"
    set theMovie to "Macintosh HD:Library:Desktop Pictures:Mac ML Opening Chalkbaord Video.mov"
    set openMovie to open theMovie
    present openMovie
    play openMovie
    delay 30
    quit
end tell
if answer is equal to "No, I've seen it" then tell application "Welcome"
    quit
    tell application "System Events"
        delete login item "Welcome"
    end tell
end tell
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:33:39+00:00Added an answer on June 11, 2026 at 2:33 pm

    My guess is that you probably need a delay between opening and playing the movie. Sometimes the code runs faster than the computer can react. If that’s the case then the movie may still be trying to open when the code tells the movie to play… thus the error. As such I added 2 repeat loops which checks for things to make sure they’re available before proceeding to the next step in the code. You also need “open file” in the code instead of just “open”.

    Your approach in your if statements of telling an application to do something is unusual. I wouldn’t do that. I would also combine your if statements into one if/else if statement. Anyway, here’s how I would write your code (I’m assuming application “Welcome” is the code itself). I hope this helps!

    set theMovie to "Macintosh HD:Library:Desktop Pictures:Mac ML Opening Chalkbaord Video.mov"
    
    tell me to activate
    set question to display dialog "Would you like a welcome video?" buttons {"No, I've seen it", "Yes, please"} default button 2
    set answer to button returned of question
    
    if answer is equal to "Yes, please" then
        tell application "QuickTime Player"
            activate
            set openMovie to open file theMovie
    
            -- delay until the movie opens
            set startTime to current date
            repeat until exists document 1
                delay 0.2
                if (current date) - startTime is greater than 10 then return -- a precaution so you don't get stuck in the repeat loop forever
            end repeat
    
            present openMovie
            play openMovie
    
            -- delay until the movie stops playing
            repeat until document 1 is not playing
                delay 1
            end repeat
    
            quit
        end tell
    else if answer is equal to "No, I've seen it" then
        tell application "System Events" to delete login item "Welcome"
    end if
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have an autohotkey script which looks up a word in a bilingual dictionary
I want to show the soap response to UIWebview.. my soap response is, <p><img
i got an object with contents of html markup in it, for example: string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.