Is there an applescript for displaying a random word from a list of supplied words?

Discussion in 'Mac Programming' started by SuperDaveInLA, Jul 21, 2010.

  1. macrumors newbie

    Joined:
    Apr 3, 2008
    Location:
    Hollywood, CA
    #1
    I have an apple workflow running off of my laptop for a DIY photo booth at my wedding. The user only has to enter his/her name - the computer then takes 3 snapshots from webcam, formats them into strip form, sends them to a printer, then loops and starts over. What I'm trying to do now is before each snapshot I'd love a dialog to show a random emotion that the user should portray in each shot.

    What I want to do is have a list of like 30 possible scenarios ("extremely happy" "shocked" "the person next to you smells", etc etc etc.) and have the computer pick one of them to display before each shot.

    Any idea how to do this?!
     
  2. macrumors 6502

    Joined:
    Oct 17, 2009
    #2
    Here you go. Edit it however you'd like:

    Code:
    set emotions to {"Happy", "Sad", "Angry", "Funny", "Confused", "Shocked"}
    set randomEmotion to some item of emotions
     
  3. thread starter macrumors newbie

    Joined:
    Apr 3, 2008
    Location:
    Hollywood, CA
    #3
    Caleb - sorry if I'm out of my league here, but that script isn't displaying anything. It's running, but I'm not seeing anything. Am I doing something incorrectly?
     
  4. thread starter macrumors newbie

    Joined:
    Apr 3, 2008
    Location:
    Hollywood, CA
    #4
    oh sweet, i think i figured it out! Added display dialog randomEmotion

    Thank you dude!
     
  5. macrumors regular

    Joined:
    Sep 9, 2007
    #5
    You can also pick from a file, etc

    There are literally dozens of ways to do this.

    Seriously, look into some of the AppleScript tutorials online. AppleScript is surprisingly powerful, and very straightforward.

    -fred
     

Share This Page