applescript if statement

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

  1. wild4life2013 macrumors newbie

    Mar 13, 2013
    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.

    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. Red Menace macrumors 6502

    Red Menace

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

    Mar 13, 2013

Share This Page