How do I pad or add leading zeros to months? For example, May would return "05"
set the_month_new to button returned of (display dialog "Choose a month:" buttons {"April", "May", "June"})
(run script the_month_new) as integer
How do I pad or add leading zeros to months? For example, May would return "05"
set the_month_new to button returned of (display dialog "Choose a month:" buttons {"April", "May", "June"})
(run script the_month_new) as integer
Try the following.
set the_month_new to button returned of (display dialog "Choose a month:" buttons {"April", "May", "December"})
set the_month to (run script the_month_new) as integer
if the_month is less than 10 then
set the_month to "0" & the_month
else
set the_month to the_month as string
end if