Export Customized Dates from Schedule with Applescript?


I’d like to be able to export the trying to export the scheduled leave I have set up for employees in OmniPlan, however I’m getting an exception that seems to indicate there may be an export error. When I run the following snippet:

using terms from application "OmniPlan"
set |resource| to (first resource in |document| whose name is "ExampleUser1")
tell |resource|
  repeat with |calendar day schedule| in calendar day schedules of schedule of |resource|
    tell |calendar day schedule|
      log specific date as text
    end tell
  end repeat
end tell
return resource_list

end using terms from

I get a console exception like the following:
get_leave.scpt:736:740: execution error: Can’t make «class OPdd» of item 1 of every «class OPse» of «class OPsc» of «class Oprs» id 29 of «class OPso» 1 of «class OPpj» of document id “aYd9y5OoQwG” of application “OmniPlan” into type text. (-1700)

Does anyone have any insights into why this might be happening?