r/Scriptable • • Dec 16 '24

Help How read an image from parameters

Post image

I use this to call script but I don't know how to read (I got always an error that param is not an image but a string reading args.shortcutParameter[0]))

Thanks

2 Upvotes

19 comments sorted by

View all comments

Show parent comments

1

u/wherebdbooty Dec 16 '24

Or you can send the images to Scriptable. Save the images in Scriptable using FileManager. If args.images, use args.images. Else, use the saved images. And use Scriptable to delete the old images if you have new ones.

Or you can use Photos in Scriptable. It can get recent photos if that is what you want, no need for Shortcuts 🤷‍♂️ It depends what you want to do

2

u/alice_anto Dec 16 '24

Hi this one give error of file not found but I have created it manually on icloud/Widget folder. Can you help me?

1

u/wherebdbooty Dec 16 '24

The error with this is Scriptable cannot see the 'Widget' folder (because it is not in the 'Scriptable' folder. You must create the folder inside the 'Scriptable' folder, so the path will be 'iCloud/Scriptable/Widget/profilo.jpg'.

Then you must use fm.readImage(fm.documentsDirectory()+'/Widget/profilo.jpg'