Script to create calendar events based on shifts in WMT Scheduler

Messages
2
Got bored sitting around at home and decided to make an AppleScript to create events in Calendar from my Web Schedule page. Figured I'd share it with you.

The script is inspired by the VoidTime app that was briefly on the iOS App Store a year or so ago. Some major changes are:
  • You can read the source code for yourself and verify I'm not doing anything nefarious.
  • It's not an app or application, just a script to scrape the info from the web and dump it in your calendar. It won't tell you what kind of leave you're on, or who else is working with you, or anything like that.
  • It only works on macOS. I don't have the skills to create a full-blown app and I wouldn't want to in any case, because then you couldn't read the source code. I imagine the idea could transfer to Windows PowerShell but I have extremely limited experience with that. Anyone who wants to attempt can feel free.
Basically the entire thing is hacked together, but it works and there's even a moderate amount of error-checking built in. That said it really works best if you enter in the proper information, please don't try to stress-test everything.

 

GulfCharlie

Comrade Commissar
FAA
Messages
649
Facility
BNA Nashville Tower
Got bored sitting around at home and decided to make an AppleScript to create events in Calendar from my Web Schedule page. Figured I'd share it with you.

The script is inspired by the VoidTime app that was briefly on the iOS App Store a year or so ago. Some major changes are:
  • You can read the source code for yourself and verify I'm not doing anything nefarious.
  • It's not an app or application, just a script to scrape the info from the web and dump it in your calendar. It won't tell you what kind of leave you're on, or who else is working with you, or anything like that.
  • It only works on macOS. I don't have the skills to create a full-blown app and I wouldn't want to in any case, because then you couldn't read the source code. I imagine the idea could transfer to Windows PowerShell but I have extremely limited experience with that. Anyone who wants to attempt can feel free.
Basically the entire thing is hacked together, but it works and there's even a moderate amount of error-checking built in. That said it really works best if you enter in the proper information, please don't try to stress-test everything.

I am still quite angry that they forced the individual to take the app down instead of seeing a solution and working with the individual. VoidTime made seeing my schedule so much easier and it populated my calendar (even with OT before I received my usual slip informing me) which I shared with my girlfriend so she could see when I was working due to schedule changes. Now my lack of scripts/coding is not up to par at the moment, but is there a way to do this on the phone?
 
Messages
2
is there a way to do this on the phone?
Theoretically yes, someone wrote an app to do it before. Short answer right now is no though.

My guess based on looking at VoidTime's settings is that he did exactly what I did: went to the WMT Scheduler website in the background and automatically entered your login information. For one I don't have the knowledge to create an app like that and for two I'm hoping that the code being readable means there will be less grief from on high about this (unlikely I know, which is why I'm staying anonymous).

In terms of porting this script to iOS, that's doubtful. I did some perfunctory searching just now and it seems like you can use Shortcuts to run an AppleScript command on a connected Mac, but you can't actually run AppleScript on an iOS device itself. Perhaps there's a way to port the whole thing to Shortcuts, I don't know—I haven't worked with Shortcuts at all. My guess is the check-which-question step is too complex, but I could be wrong.

I really don't know much about PowerShell but there may be a way to do it on Windows as well, a quick google produced this post showing how to create a calendar appointment using PS. Maybe that'll be my next project, if there's interest.
 
Top