View Single Post
Didn't know if anyone was interested but here is my solution, as a subroutine, to determine if a date is a working day or not. If your project is working on a lower granularity than days this can, hopefully, provide a good starting point.

Code:
on isWorkingDay(_date)
    tell application "OmniPlan"
        tell schedule of project of document of front window
			
            -- Check that the _date is not a calendar exception (such as a holiday)
            if first item of (calendar day schedules where specific date is _date) is not missing value then
                return false
				
            --  Also check and see if the day of the week is a normal working day
            else if duration of item (weekday of _date as integer) of week day schedules is 0 then
                return false
				
            -- Otherwise, it is a working day
            else
                return true
            end if
        end tell
    end tell
end isWorkingDay