applescript if statement

Discussion in 'Mac Programming' started by wild4life2013, Aug 5, 2013.

  1. macrumors newbie

    Joined:
    Mar 13, 2013
    #1
    With the example below how can I check if difference is between 7 and 10 I would like to run another bit of code then else if difference is greater than 10 then run some other code.


    Code:
    set CurrentDate to current date
    set this_date to "17/8/2013"
    set difference to ((date this_date) - CurrentDate + 1 * days) div days as number
    thanks for your help
     
  2. macrumors 6502

    Joined:
    May 29, 2011
    Location:
    Littleton, Colorado, USA
    #2
    This kind of basic information can be found in the AppleScript Language Guide, for example:
    Code:
    if difference > 7 and difference ≤ 10 then
    	-- do this
    else if difference > 10 then
    	-- do that
    else
    	-- do something else
    end if
     
  3. thread starter macrumors newbie

    Joined:
    Mar 13, 2013
    #3
    Thank you Red Menace for your help
     

Share This Page