Fetch PTV Timetable with Scriptable, add to iOS Widget.
- Fetch Myki Balance visit: MykiBalance
Important! This Widget is not affiliated to PTV or Myki. For personal use only.
-
Download Scriptable from App Store
-
Add new Script on Scriptable. You can choose to add
MediumorLargeWidget. And you can always duplicate and rename the Script to add multiple timetable for iOS Stack Widget-
For Medium Widget
Copy Everything in timetable_medium.js and paste to your new Script.
-
For Large Widget
Copy Everything in timetable_large.js and paste to your new Script.
-
What's the difference between
MediumandLargeWidget?Medium Widget is for someone who know exactly their route is, or they only wants to check one route at a time. Large Widget can show multiple routes between two stops. Generally, Large Widget needs more time to response as the code need more time to match all the routes avaliable.
-
-
Run the code, you can see an example preview of the timetable: the top one is
Medium, the bottom one isLarge -
Change the value inside " " to customize your PTV timetable.
routeType: Train0,Tram1, Bus2, V/Line3, Night Bus4routeName:(Not necessary for Large Widget)-
Train: eg.
AlameinorAlamein Line,BelgraveorBelgrave Line -
Tram: Route number is ok, eg.
1,3-3a,96etc. If not, try full name eg.1 East Coburg South Melbourne Beach -
Bus: Route number is ok, eg.
200,207,900etc. If not, try full name eg.200 City - Bulleen -
V/Line: Must use route full name, eg.
Ballarat-Wendouree - Melbourne via Melton -
To search the route full name, please visit https://www.ptv.vic.gov.au/routes
fromStop: Your Departure Stop Name.-
Train: eg.
Flinders Street Station. Do not contain "Railway" if your route type is0for train. -
Tram: eg.
Federation Square/Swanston St #13 -
Bus: eg.
Caulfield Railway Station/Sir John Monash Dr -
V/Line: eg.
Flinders Street Railway StationMust contain "Railway" if your route type is3for V/Line. -
Go PTV App or website to find stop name. Make sure use the full name of the stop to get the most accurate result.
toStop: Your Arriving Stop Name. -
-
Run the code again, you will see your timetable if all the values are valid and correct. (If something wrong, please report an issue with all the values you changed, and I will look into it for you)
-
Go to your Widgets library and find Scriptable, make sure pick the Middle/Large one and Add Widget to your home screen (Not support layout for Small Widget)
-
Long press the Widget and go Edit Widget. Choose the
Scriptyou Added, setWhen InteractingtoRun Script, so you can manually update your timetable by tapping the widget, leaveParameterempty -
Now you may see the Magic, Enjoy!
![]() |
![]() |
![]() |
![]() |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |








