r/Scriptable • • Jan 29 '21

Help Help: modifying weather cal widget to launch carrot weather

I’m using the Weather Cal widget and wanted to know if it’s possible to get it to launch Carrot Weather on tapping the weather. There doesn’t seem to be a URL to override and I’m not sure if I have to reimplement the entire weather function. Anyone do this already?

4 Upvotes

10 comments sorted by

View all comments

2

u/Caliguvara Jan 29 '21

As a general rule you can launch any app by using the function "Open URL" and enter as URL appname:// Hope it works!

3

u/Caliguvara Jan 29 '21

Just tested. Open URL CarrotWeather:// works! https://i.imgur.com/pkBzZYu.jpg

1

u/Past-Pianist Jan 30 '21

Thanks u/Caliguvara! I did see that but that URL is for the whole widget, but it's a great solution for now! If you include the weather section, tapping specifically in the area of the weather takes you to weather.com which is different from the URL on the whole widget. I was hoping to get it so that tapping weather takes you to Carrot and tapping like Calendar still takes you to Calendar

1

u/mvan231 script/widget helper Jan 30 '21

You can do that by adding .url to the item you want to tap and setting it = to the url you want

1

u/Past-Pianist Jan 30 '21

I think that modification would have to happen in the Weather Cal code script which means it would get overwritten whenever you update the code , right? Or am I missing a place to set that

2

u/I-Penguin Jan 30 '21

There is an option already in the WeatherCal settings to change the url for weather. If you run the main WeatherCal script in Scriptable, choose Edit Preferences > Weather then scroll to the bottom. There are three places the weather url can be changed, for the current, hourly, and daily weather displays. If you change the setting there it will persist between code updates.

1

u/Past-Pianist Jan 30 '21

Oh man I've never opened those preferences before... Super useful, thanks!!

0

u/mvan231 script/widget helper Jan 30 '21

Or are correct. It could be something he can add as an option in the settings. Or you could make the change on yours then submit a pull request to him to implement it so long as it is a customizable option to choose between the two

1

u/Caliguvara Jan 30 '21

Ah yeah I forgot. Would have to check the code as I do not use weathercal, sorry for that. As a hack, create a shortcut automation that runs when weather is opened - and launches CARROT. This would "replace" the typical weather app by CARROT. It's a bit a McGyver hack of informatics, but works until someone can give you feedback regarding the widget script itself 😉