A question for folks as I am a bit stuck and trying to figure my head around this issue, curious if any of the hive mind here have any clarity they can provide.
Essentially I have the table below that I am using for separate sheets within a spreadsheet (Either yearly or quarterly), what I am attempting to do is to have it read through the table and get the period (P1 for example), Start date and end date, then if the current date is within those dates to set the page to said date, for example if it was this day (03/09/25) then it would set the page to sheet P6 for example.
Where I’m getting stuck is in the process of reading the items back in, so I can then use it in the process, essentially I am wanting to break it into 3 items (Currently using tab for this) so I can then use an if statement to be able to compare it to the current date then set it to the applicable sheet, I’ve been trying to use text item statements but when I do so it doesn’t compile so I am coming to ask for a bit of a more experienced eye and to learn hopefully, I’v been reading up on the use of TID’s but still is a bit of a mystery to me.
Test code I am playing with currently:
use AppleScript version "2.8" -- Yosemite (10.10) or later
use scripting additions
use framework "Appkit"
on run
set fY to "Fiscal Year"
set currentDate to current date -- Complete date
tell application "Numbers"
set docMain to (choose file with prompt "Please select Fiscal sheet") as text
set MyTable to table fY of sheet fY of document 1
set myList to {}
launch
activate
set myDoc to open (docMain)
repeat with i from 2 to (count of rows of MyTable) -- Top row is just titles
repeat with c from 1 to (count of columns of MyTable)
set cellValue to value of cell c of row i of MyTable
set end of myList to cellValue
end repeat
end repeat
return myList
try
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to tab
(* set sDay to every text item 2 of myList
set eDay to every text item 3 of myList *)
set AppleScript's text item delimiters to oldDelims
on error
set AppleScript's text item delimiters to oldDelims
end try
end tell
end run