IOS Widget - Black Box

Hey Guys,

I’m new to scriptables and full disclosure am terrible at coding.

With the help of ChatGPT I’ve managed to get the script to work, however when I add the widget to my iPhone it’s just a black box.

This is where I’m struggling, can’t seem to get the code working that changes that. I’d love to some how make it a red off icon button, but would be just as happy with a black box that has ‘Off’ in red.

I’ve tried to read some of the other posts, but unfortunately as this is not my strong point, haven’t been able to follow too well.

Thanks,

Dave

It’s not easy to know what’s wrong without seeing you script.
One reason is that you may not have assigned your widget to the script using setWidget. See the example script below.

Another, more common, reason is the script is using to much memory for it to load on a widget outside the main application.

const widget = new ListWidget()

// your widget content
widget.addText('Hello')

// set the widget to be displayed
Script.setWidget(widget)
2 Likes

Thanks mate!

I have a feeling it was a memory thing, though ive changed my approached and gone down a different route which is now working.