How do I set tap targets for scriptable widgets?

I have a widget that runs scripts using URL scheme, how do I configure tappable stacks?

Each stack has a .url property. Assign the url scheme to it.


let pStack = imgs.addStack()
let pImage = await getImage("plus.png")
pStack.setPadding(0, 0, 0, 0)
pStack.url = "scriptable:///run/markup-habit"


Yes, that’s correct.

How do I configure the widget?

Any of those except Open URL. I made some test any it seems like tap targets don’t work on small widgets. Could that be what you’re having?

THANK YOU!!! That was the problem!

super excited because this has been plaguing me for days and i can finally continue on this widget!

Thanks for the tip! Any idea why small widgets don’t work?

I found that small widgets actually have 1 tap target. See the guidelines.

A small widget supports a single tap target, but medium and large widgets can offer multiple targets.

I tested it using the ListWidget.url property and it works.

Ah. The whole widget is a target. Good to know; doesn’t work for mine anyway.

Thanks for your help!