This might actually be my last request for help, hopefully, at least for some time.
In my project, I'm giving the user the choice of type of date picker. I'm having problems getting the terminology for the contextual date picker right however. I'm assuming I should be able to set the values with NSDates, but the handler is failing when it try to 'setDateValue'.
Shane's examples from Explored 4 work, but mine doesn't , but Shane does not use the 'setDateValue' in the example.
I don't get past '5' and '7' in this handler. I've tried with double brackets, and without the curly brackets, but my basic terminology must be incorrect.
on switchOverTimes_(sender)
try
say my datePickerTypeFlag as text
if my datePickerTypeFlag then
say 1
set my datePickerStartNSValue to (my datePickerStartNS's dateValue())
say 2
set my datePickerFinishNSValue to (my datePickerFinishNS's dateValue())
say 3
set temp to (extras's fordNSDateToASDate_(my datePickerStartNSValue))
set my datePickerStartAS to (((temp) as date) as text)
say 4
set temp to (extras's fordNSDateToASDate_(my datePickerFinishNSValue))
set my datePickerFinishAS to (((temp) as date) as text)
say 5
my datePickerStartAS's setDateValue_({my datePickerStartNSValue})
say 6
my datePickerFinishAS's setDateValue_({my datePickerFinishNSValue})
else
say 7
set datePickerStartNSValue to (my datePickerStartAS's dateValue())
say 8
set datePickerFinishNSValue to (my datePickerFinishAS's dateValue())
say 9
set temp to (extras's fordNSDateToASDate_(my datePickerStartNSValue))
set my datePickerStartAS to (((temp) as date) as text)
say 10
set temp to (extras's fordNSDateToASDate_(my datePickerFinishNSValue))
set my datePickerFinishAS to (((temp) as date) as text)
say 11
my datePickerStartNS's setDateValue_({my datePickerStartNSValue})
say 12
my datePickerFinishNS's setDateValue_({my datePickerFinishNSValue})
end if
set temp to ((extras's fordNSDateToASDate_(my datePickerStartNSValue)) as date) as text
display dialog "NS date" & return & return & temp as text
display dialog "applescript date" & return & return & ((my datePickerStartASValue as date) as text)
on error errmsg
display dialog "switchOverTimes " & errmsg & return & return & "p = " & p
end try
end switchOverTimes_