hey, I wrote this yesterday, (with the help of some macscripter members to get it working properly, and to clean it up a bit.
This is the second script I have ever written other than telling finder to say something. heh.
It is based on an effect I have been doing for years, it is a great life effect, because the ‘fishing’ can be done in a manner that hides it.
I am going to star working on a version with actual cards in the questions and answers, but now I have the basic structure, I think I can do it. I have made vector images of an entire deck. so I think it will work.
Just think of any card in a deck, and it will be revealed to you
let me know what you think.
property cardList : {"King", "Ace", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "--You cheated, it wasn't in all four!"}
property colorList : {«data utxt2665», «data utxt2666», «data utxt2660», «data utxt2663»}
property questionList : {"Is the rank of your card equal to any of these? 3, Jack, 5, Ace, 9, 7?", "Ok, how about these? 10, 3, 6, 2, 7, Jack?", "Almost done, how about these? 5, Queen, 6, 7, 4?", "Last round: Queen, 9, 8, Jack, 10"}
repeat
tell application "Finder" to display dialog "Think of any playing card in a normal deck...
And for the moment, just forget about the suit, and the color of your card. Only think of the number or letter."
set theResult to 0
repeat with i from 1 to 4
set b to button returned of (display dialog item i of questionList buttons {"No", "Yes"})
if b is "Yes" then set theResult to (theResult + (2 ^ (i - 1))) as integer
end repeat
try
set theResult to item (theResult + 1) of cardList
exit repeat
on error
display dialog "--You cheated, it wasn't in all four!" buttons {"Cancel", "Try Again"} default button 2
end try
end repeat
--figure out the color
tell application "Finder" to display dialog "Great, now I want you to remember the color of your card. Imagine it bright and vivid in your mind."
if button returned of result is "OK" then
tell application "Finder" to display dialog "Ok, I am getting something, does the word 'cherry' mean anything to you?" buttons ["Nope", "Yes, it does"]
if button returned of result is "Yes, it does" then
set theColor to 1 -- "red"
else
set theColor to 3 -- "black"
display dialog "Oh.. well I meant 'Black Cherry', we'll move on."
end if
end if
display dialog "Your card is a " & item theColor of colorList & " correct?" buttons ["No, its not", "Yes, it is"]
if button returned of result is "Yes, it is" then
display dialog "I thought so, you're thinking of the " & theResult & " of " & item theColor of colorList buttons {"Have a great day!"} default button 1
else
display dialog "Oh, well I sometimes have trouble with the " & theResult & " of " & item (theColor + 1) of colorList buttons {"Have a great day!"} default button 1
end if