content: property pTitle : "Get a datetime in FT format"
  property pVer : "0.03"
  
  property pOK : "OK"
  property pCancel : "Cancel"
  
  property pstrDefault : "now"
  
  property pblnSeconds : false
  --
  -- To install Mike Taylor and Darshana Chhajed's Python parsedatetime module:
  -- 	Visit https://github.com/bear/parsedatetime
  --  		(Licence: https://github.com/bear/parsedatetime/blob/master/LICENSE.txt)
  --	Download and expand https://github.com/bear/parsedatetime/archive/master.zip
  --	in Terminal.app cd to the unzipped folder 
  --	(e.g. type cd + space and drag/drop the folder to the Terminal.app command line, then tap return)
  --	sudo python setup.py install
  
  on run
  	set {strPhrase, blnEsc} to {pstrDefault, false}
  	tell application id "sevs"
  		set strAPP to item 1 of (get name of processes whose frontmost is true) -- for restoring focus post dialog
  	end tell
  	tell application "FoldingText"
  		repeat until blnEsc
  			set strDefaultTime to my ParseTime(strPhrase, pblnSeconds)
  			if pblnSeconds then
  				set strSeconds to "Exclude seconds"
  			else
  				set strSeconds to "Include seconds"
  			end if
  			activate
  			try
  				tell application id "sevs"
  					activate
  					tell (display dialog "Result:" & tab & strDefaultTime default answer strPhrase buttons {pCancel, strSeconds, pOK} ¬
  						cancel button pCancel default button pOK with title pTitle & "  ver. " & pVer)
  						set {strButton, strPhrase} to {button returned, text returned}
  						set blnEsc to strButton = pOK
  						if not blnEsc then set pblnSeconds to not pblnSeconds
  						set strDefaultTime to my ParseTime(strPhrase, pblnSeconds)
  					end tell
  				end tell
  			on error
  				set blnEsc to true
  			end try
  		end repeat
  	end tell
  	tell application strAPP to activate -- restore the focus lost to the dialog (lest we lose the expanded text)
  	do shell script ("sleep .1")
  	return strDefaultTime
  end run
  
  
  -- Use Mike Taylor and Darshana Chhajed's Python parsedatetime module 
  -- to get a parse of a natural language expression as a series of integers {year, month, day, hour, minute}
  -- (defaults, if parse fails, to current time)
  on ParseTime(strPhrase, blnSeconds)
  	set strSec to ""
  	if blnSeconds then set strSec to ":%S"
  	
  	set str to do shell script ¬
  		"python -c 'import sys, time, parsedatetime as pdt; print time.strftime(\"%Y-%m-%d %H:%M" & ¬
  		strSec & "\", time.struct_time(pdt.Calendar().parse(sys.argv[1])[0]))' " & ¬
  		quoted form of strPhrase
  end ParseTime
  