Hello,
This is my first post here, and I apologise if this has already been covered (I had a look, but couldn’t find what I was after). The problem I have is this: My Filemaker Pro (8) database has two fields of relevance here (a Month field, and a year field, text and number respectively) from these two fields, I need to populate the contents of a date field with an actual date (i’ve picked the 15th/mm/yyyy, as it’s the middle of the month) so that I can generate a schedule based on it.
I’ve written an Applescript which gives the user a list of months, then a list of years (and these then fill the appropriate fields in Filemaker, but the actual date field refuses to fill (even though Applescript reports no errors). It just runs, the Month and Year fields fill ok, but there’s nothing in the date field. Anyway, here’s the script (I hope you can help):
set options_A to {“January”, “February”, “March”, “April”, “May”, “June”, “July”, “August”, “September”, “October”, “November”, “December”}
set theMonth to (choose from list options_A with prompt “UK availability month” without multiple selections allowed) as text
set options1_ to {“2006”, “2007”, “2008”, “2009”, “2010”, “2011”, “2012”, “2013”, “2014”, “2015”, “2016”, “2017”, “2018”, “2019”, “2020”}
set theYear to (choose from list options1_ with prompt “UK availability year” without multiple selections allowed) as number
set theDay to 15 as integer
tell application “FileMaker Pro”
set field “UK availability month” of current record of front window to theMonth
set field “UK availability year” of current record of front window to theYear
if theMonth = January then
set aMOnth to 1 as integer
if theMonth = February then
set aMOnth to 2 as integer
if theMonth = March then
set aMOnth to 3 as integer
if theMonth = April then
set aMOnth to 4 as integer
if theMonth = May then
set aMOnth to 5 as integer
if theMonth = June then
set aMOnth to 6 as integer
if theMonth = July then
set aMOnth to 7 as integer
if theMonth = August then
set aMOnth to 8 as integer
if theMonth = September then
set aMOnth to 9 as integer
if theMonth = October then
set aMOnth to 10 as integer
if theMonth = November then
set aMOnth to 11 as integer
if theMonth = December then
set aMOnth to 12 as integer
set theDate to {theDay, aMOnth, theYear} as date
set field “Finished book date” of current record of front window to theDate
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end tell
Thanks in advance,
Kev.