Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

lvar

macrumors newbie
Original poster
Oct 2, 2015
22
7
NL
Hello everyone!

I would like to create a shortcut to open a get a variable from my calendar, open a webpage and fill the form field with the variable.

I’ve managed to get the variable, open the webpage, but for the life of me I can’t fill the field.

Can anyone point me in the right direction? Is it even possible?

Thanks for any useful info you can provide!

-Ivar
 
Last edited:

Jessica Lares

macrumors G3
Oct 31, 2009
9,612
1,057
Near Dallas, Texas, USA
Since it's a properly marked up form, you can just use Get Contents of URL. You can't run JS on a webpage unless you use it as input through the share sheet.

Change the method to POST (it's going to submit the form when you run the shortcut), and set the request body to Form.

Tap on the plus to add a new field. The value type is text, the key is flight (because that's the name given to the input on the form), and the text value is your variable.

IMG_860354531DF4-1.jpeg

It auto refreshes by the way, so you might grab the text afterwards and show it in an alert.
 
  • Like
Reactions: lvar

lvar

macrumors newbie
Original poster
Oct 2, 2015
22
7
NL
Since it's a properly marked up form, you can just use Get Contents of URL. You can't run JS on a webpage unless you use it as input through the share sheet.

Change the method to POST (it's going to submit the form when you run the shortcut), and set the request body to Form.

Tap on the plus to add a new field. The value type is text, the key is flight (because that's the name given to the input on the form), and the text value is your variable.

It auto refreshes by the way, so you might grab the text afterwards and show it in an alert.

Ooh, that is awesome, I didn’t know about that action!
The website does autorefresh; normally it reloads the data but with the shortcut it clears it, so I did what you suggested, grabbed the text and used part of it to put in an alert.
I’ll build on it a little more in the future probably but this does what I wanted it to do.

Thanks for this!!!
 

Dzip

macrumors newbie
Sep 21, 2020
1
0
Hi,
This information is useful! Thanks :)
do you know if I can mark a checkbox? as well as send the form?

-Dror
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.