Applescript trouble - testing against Label Index

Discussion in 'Mac Programming' started by Terminal Frost, Jan 16, 2013.

  1. macrumors newbie

    Joined:
    Jan 16, 2013
    #1
    I'm at my wits end trying to do something that seems rather simple. Over and over in examples throughout many forums, I've seen examples of the below code used:

    Code:
    set theFile to "path" as alias
    if label index of theFile is 0 then
    It seems obvious to me that this would be the correct syntax, but particularly maddening is the fact that this syntax appears to work for everyone else except me! But every time, the editor highlights "index" and returns

    Code:
    Expected “then”, etc. but found property.
    The interpreter appears to be confused by the fact that the 'label index' property has two words. Are all the examples I'm reading old? The machine has Lion installed.

    Help me, obi wans kenobi. You guys are my only hope.
     
  2. macrumors 6502

    Joined:
    May 29, 2011
    Location:
    Littleton, Colorado, USA
    #2
    The label index is a Finder term, and needs to be in a Finder tell statement.
     
  3. thread starter macrumors newbie

    Joined:
    Jan 16, 2013
    #3
    Pardon me while I kill myself.
     

Share This Page