Here’s a more playful script…
This app will create a new folder named “Waldo” on your desktop, show it to you, then move it to the top level of some folder in your home directory (e.g., ~/Pictures). You then have 30 seconds to find it. If successful, you will advance to the next level which just means you have 5 less seconds to find Waldo. You can save the script below as an application and just double-click it from the Finder to start the game.
The only problem I see with it is if you have a folder named Waldo somewhere in your home directory but even then, you should get an error if the script tries to move the Waldo folder from your desktop to the same folder where the pre-existing Waldo already lives. If a folder named Waldo already exists on your desktop, you’ll get an error when it tries to create the original folder.
OS version: OS X
set home_folder to (path to "cusr") as string
tell application "Finder"
set the_level to 0
set the_timer to 35
set advance_to_next_level to true
repeat
if advance_to_next_level = true then
set the_level to (the_level + 1)
set the_timer to (the_timer - 5)
if the_level = 7 then
set the_level to 6
set the_timer to 5
end if
end if
activate
set visible of (every process whose visible = true and frontmost = false) to false
close every Finder window
set the_location to (home_folder & (some item of (get name of every folder of folder home_folder)) & ":")
set Waldo to (make new folder at desktop with properties {name:"Waldo"}) as alias
select Waldo
open selection
set the_button to button returned of (display dialog "See this folder? I'm about to hide it somewhere in your home directory. You are on level " & the_level & " and have " & the_timer & " seconds to find it. Ready?" buttons {"Quit", "Hide It!"} default button 2 with icon 1)
if the_button = "Quit" then
close every Finder window
delete Waldo
display dialog "Thanks for playing, hope you had fun!" buttons {"Goodbye!"} default button 1 with icon 1 giving up after 10
return
else
close every Finder window
move Waldo to folder the_location
set start_time to (current date)
set the_message to ""
repeat
set chosen_folder to (choose folder with prompt (the_message & "Find Waldo:")) as string
set end_time to (current date) - start_time
if chosen_folder = (the_location & "Waldo:") then
if end_time < the_timer then
set the_response to "Congratulations! You found Waldo in less than " & the_timer & " seconds!"
set advance_to_next_level to true
else
set the_response to "Oooh! You found Waldo but it took more than " & the_timer & " seconds!"
set advance_to_next_level to false
end if
exit repeat
else
if end_time > the_timer then
set the_response to "Oooh! You didn't find Waldo and your time is up! (He was hiding in " & the_location & ".)"
set advance_to_next_level to false
exit repeat
end if
end if
set the_message to "Nope, try again. "
end repeat
select folder (the_location & "Waldo:")
set the_button to button returned of (display dialog the_response buttons {"Quit", "Play Again"} default button 2 with icon 1)
close every Finder window
delete folder (the_location & "Waldo:")
if the_button = "Quit" then
display dialog "Thanks for playing, hope you had fun!" buttons {"Goodbye!"} default button 1 with icon 1 giving up after 10
exit repeat
end if
end if
end repeat
end tell