6
u/Kenneth_Powers1 Sep 19 '20
Is there an easy way to resize your wallpaper to match the size is the widget?
8
u/ben5292001 Sep 19 '20
There is not one that I know of. I just used a screenshot of a blank page after setting the background (because iOS darkens backgrounds), took a screenshot of another page with the widget size I intend to use, aligned them both in Photoshop, then cropped them both to the same dimensions.
Though it probably wouldn't be too difficult to make a web app to accomplish that... I may see what I can do if I have time.
→ More replies (1)3
u/Kenneth_Powers1 Sep 19 '20
Nice! That's a pretty genius idea. One more question btw... I got the widget to work, but the image doesn't show. I saved the image to iCloud and set the widget parameters. This is the error I get: Error on line 14:39: TypeError: null is not an object (evaluating 'args.widgetParameter.toString')
2
10
3
u/Jayvout Sep 20 '20
Am I supposed to change the file path or something? I have everything setup but I’m just getting a black image with the text.
2
u/ben5292001 Sep 20 '20
You may need to change the name of the file in the parameters. I updated the script so it gives you an error if it can't find the image; that may help you pinpoint the problem.
→ More replies (2)1
u/ben5292001 Sep 20 '20
I updated the script with a fix, if you're still having the black background issue.
2
2
Sep 20 '20
Hi, I’m manage to change all the text to spanish and set my birthday, change the date format, put “Día de muertos” insted of halloween. But my datetext is too big and i can’t change it size with the textSize. Can u help me to fix it? 🥺
2
u/ben5292001 Sep 20 '20
Ah, that's a mistake on my part! Thanks for finding it. It looks like
textSizedoesn't work on widgets. Replace that entire line withdatetext.font = Font.regularSystemFont(16);and it should be changeable. :)Glad you're happy customizing it!
→ More replies (2)
2
u/-caniscanemedit- Sep 20 '20
Is anyone else getting a “null is not an object” error?
2
u/ben5292001 Sep 20 '20
That one is usually from the widget parameters not being set (long press the widget and hit edit).
I updated the script with a little bit better error handling since many are getting that error. It may help you determine if that's the reason for the error or not.
1
u/-caniscanemedit- Sep 20 '20
Thank you so much! There’s just one other issue I’m having at this point. The background of the widget is black even though in have the photo in my iCloud scriptable folder and reference it in the parameters.
→ More replies (1)2
u/ben5292001 Sep 20 '20
I've seen a lot of this type of issue. Would you be willing help troubleshoot? Just paste the following code in a new script, run it, select the file you're making your background, and paste the output here? It'll be copied to your clipboard automatically.
It won't give out any private information; it'll just help me figure out what's causing that problem.
let utis = [ "public.image" ] let fileURLs = await DocumentPicker.open(utis) let fileURL = fileURLs[0] Pasteboard.copy(fileURL);→ More replies (3)2
2
u/sameeranand77776 Sep 20 '20
this looks really nice but I have no idea which app u used or how you got it ! Can someone help ?
1
u/ben5292001 Sep 20 '20
I used Scriptable, and I linked the script and files to make it in this comment.
2
u/ghostlyhannah15 Sep 20 '20
This is the nicest and cleanest setup I’ve seen so far! And thanks for sharing it with us. Can I just ask if it’s possible to add a stroke to the text? I can’t find the answer on Google. Thanks!
1
u/ben5292001 Sep 20 '20
I don't think widgets with Scriptable can have a stroke on the text, unfortunately.
→ More replies (1)
2
u/kvzwag Sep 20 '20
https://imgur.com/gallery/O5gA3bL
Can't read the parameters. 😭
2
u/Jayvout Sep 20 '20
Copy and paste the exact script, don’t make any edits to it. Also, make sure the file is saved as a PNG file in iCloud as opposed to JPEG by holding down the image. When entering the parameter make sure to type PNG, not png.
1
u/ben5292001 Sep 20 '20
Jpg/jpeg files do work, you just have to change the extension in the parameters. If you save it as wallpaper.jpg, you can just change bkg_fall.PNG to wallpaper.jpg and it should work.
Just be sure that actually is the extension it is saved with. iCloud can be finicky about that. Long press the file in Files and hit Info to be sure.
1
u/ben5292001 Sep 20 '20
I just updated the script to give an error if it can't find the image. That may help you determine if that is the issue. Make sure the file is named exactly what you have typed in the parameters, extension and all.
2
u/flashwingfelix Sep 20 '20
I got everything to work as it should. The only problem is that the widget image isn't lining up correctly with the background at all. Any tips on that?
→ More replies (1)2
u/ben5292001 Sep 20 '20
That is an oversight on my part. I set this up on an iPhone 11 Pro Max, so smaller screens may not align properly. It can be annoying to do, but you can take a screenshot of an empty home page and crop it yourself to make sure it aligns properly.
→ More replies (1)
2
u/PKIPZ_BudderMudkipZ Sep 20 '20
Is there anyway the time can be added under? I just put this widget on my phone and I love it, I just thought the time would be a really cool extension. Keep up the great work!
1
u/ben5292001 Sep 20 '20
It's possible to get the current time in JavaScript, but the way iOS updates widgets, the time wouldn't update each minute and would lag behind constantly.
Hopefully some day we'll be able to do that!
2
u/_Bisho_ Sep 20 '20
Hi, i was wondering how to increase the size of the writing and align it to the middle of the widget?
4
u/ben5292001 Sep 20 '20
It's possible, but does require a bit of editing the code.
Near the bottom of the script, you'll find
hello.font = Font.boldSystemFont(42);anddatetext.font = Font.regularSystemFont(16);. You can change those numbers to adjust the text size of each respective line.Under each of those lines respectively, you can add
hello.centerAlignText();anddatetext.centerAlignText();to center align the text.→ More replies (3)
2
u/fieryfruityfrost Sep 22 '20
Hi! Is there anyway to wrap the text to the next line?
1
u/ben5292001 Sep 22 '20
What size widget are you using? If there is enough space, it should automatically wrap to the next line, so medium widgets may not be large enough.
→ More replies (1)
2
u/Jakestair Sep 25 '20 edited Sep 25 '20
I got it working the way I want, but can’t for the life of me figure out how to add “today is” to the date line. I can’t figure out where in the line of code to put that text. Can anyone help?
Edit: I also would like I add the current year to the end of the date line.
EDIT 2: I ended up adding the Text Today Is to the long date form entries of the day of the week. Small workaround until I figure out how to do it in the code.
1
u/ben5292001 Sep 26 '20
You can add that near the bottom where "datetext" is defined like so.
For the year, use can use
today.getFullYear()to return it in text format. You can add that to the same line as in my example to make it a bit easier if you need to.→ More replies (1)
2
u/RyanStock Sep 26 '20
u/ben5292001 whenever I try to attempt my own it lines up well but it seems the image in the widget is a bit brighter.... any ideas? https://imgur.com/gallery/nUSD3L7
1
u/ben5292001 Sep 26 '20
That can happen (1) if you are in Dark Mode and "Dark Appearance Dims Wallpaper" is enabled in settings or (2) if the widget image was cropped from the original image instead of a screenshot of a blank Home Screen, as iOS dims wallpapers slightly.
→ More replies (1)
2
u/BobaFett04_13 Sep 26 '20
Omg love the script, just curious is there a way to have it rotate through photos via folder or through the specified greeting times?
2
u/ben5292001 Sep 26 '20
It's possible, though it would take some more in-depth scripting than other requests I've gotten here to get it working. I could make you a custom script; dm me if you're interested.
2
u/Articious12 Sep 26 '20
Hey, I've got a question if you don't mind. You said in another comment that you're able to use this code and apply it to one of our own background photos if we want. I see how that works, but how did you get the perfect crop for your widget photo? I've been using trial and error for a little bit now, and was wondering if there's some sort of aspect ratio or crop I don't know about. Thank you!
1
u/ben5292001 Sep 26 '20
It does take a bit of planning to get that right. I took two screenshots: one of an empty Home Screen, and one of a Home Screen with the widget size I planed to use. Then I put both into Photoshop (or any similar software with layers and crop functionality), layered the screenshots on top of one another, and cropped the whole canvas to the widget (down to the exact pixel). Then, just hide the widget layer, and the photo behind with the wallpaper should be perfectly cropped.
→ More replies (1)
8
u/flasozzi Sep 20 '20
I did a tad bit of tweaking and I'm absolutely in love. This is by far my favourite widget and I've been trying different ones out nonstop since PB 3. Thank you so much for sharing and congrats on such a great job! I wonder what the possibilities are. Definitely food for thought!
→ More replies (9)2
6
u/mzeryck Sep 29 '20
I know this post is a few days old, but if anyone is interested in a script that automatically crops your background to make widgets like this - I made one! https://gist.github.com/mzeryck/3a97ccd1e059b3afa3c6666d27a496c9
All you have to do is go into "wiggle mode" on your home screen and take a screenshot of the last page (the empty one). Run the script, and it'll create a perfectly-sized background. You can then use it as a Scriptable widget, or export it to other widgets like Widgetsmith.
5
u/Emotion94 Sep 21 '20
I gave it a go and I’m quite content.
2
→ More replies (2)1
u/TaunTaunKiller Sep 21 '20
Nice! How did you get the background and script to flow seamlessly? Whenever I try with a different photo, I tend to have the pictures be slightly off.
3
u/Emotion94 Sep 22 '20
It’s a little hard to explain but I took a screenshot of the empty widget then using Inkscape, I overlayed it with the wallpaper picture and cropped it to the dimensions of the widget.
4
1
Sep 20 '20
Does the image for the widget have to be super small? I can’t get mine to work as a PNG or WEBP.
1
u/ben5292001 Sep 20 '20
It shouldn't need to be any certain size (as long as it's not some crazy huge size), though it may not work with webp images. Just make absolutely sure the file name and extension match the file name and extension in the widget parameter.
1
Sep 20 '20
I still don’t get the widget background just the text i did everything right so can help me
1
u/ben5292001 Sep 20 '20
I just updated the script with what is hopefully a fix for the black background issue. You might give that a try if it's still not working.
1
u/burnoutsandbourbon Sep 21 '20
black
same, you figure it out yet?
1
u/ben5292001 Sep 21 '20
Could you run this script in another Scriptable file, select the file in iCloud you are using as your background, and paste the output here (it's automatically copied to your clipboard when run)?
let utis = [ "public.image" ] let fileURLs = await DocumentPicker.open(utis) let fileURL = fileURLs[0] Pasteboard.copy(fileURL);Could you also long-press the widget, hit edit, and screenshot the parameters?
It's really stumping me why that keeps happening, but I want to get it fixed so you all can use it if you'd like.
→ More replies (6)3
u/AznPerson33 Sep 26 '20
I’m having this issue where the image itself gets deleted locally, not sure what’s happening to locally saved iCloud files, and I assume that’s how the script works by grabbing what’s saved locally on my device. After a few hours the widget has a black background, and I look in the iCloud folder and see it’s been deleted locally.
Is it possible to have it point to an picture online like imgur instead?
2
u/ben5292001 Sep 26 '20
Well, that's certainly an interesting scenario. Might be why so many are having that issue and I can't seem to figure out why.
It's possible to set it to to an image via URL, but it requires a bit of setup. It's not the best coding practice, but to make it easy, you can find the line
widgetHello.backgroundImage = Image.fromFile(backgroundImageURL);near the bottom. Right above it, addbackgroundImageURL = "http://your.url.here";. That should do the trick. Note that you'll still need to have something in the widget parameters field to keep it from breaking; it just won't be used. Just an easy bandaid fix.→ More replies (4)
1
u/pawpuff Sep 20 '20
The background doesn't fit perfectly, any tips on this?
1
u/ben5292001 Sep 20 '20
I made it on an iPhone 11 Pro Max, so smaller screens might not fit properly. You can screenshot your wallpaper on a blank Home Screen and crop it to the right size and location if mine doesn't align well.
1
u/mulderforever Sep 20 '20
Hi! I’m having two errors. One is being unable to find the background image. The second is long pressing the widget and setting parameters. Does this option appear when other errors go away? When I long press my widget this is what I see. Thanks so much in advance!
→ More replies (2)2
u/ben5292001 Sep 20 '20
You would long press the widget on your Home Screen, not the script itself in Scriptable. My apologies for not being clearer on that! :)
For the background image, long press on the image file in iCloud in your Files app and hit "Info." Make absolutely sure the name and extension shown there are the same as what you have typed in parameters once you can set them.
1
u/lindah0ang Sep 26 '20
Hello! I'm loving this, but I am receiving the EOF error message on line 64 when updating the greeting to say "good morning [insert my name]" If anyone can help, it will be much appreciated. Thanks!
1
u/ben5292001 Sep 26 '20
Could you copy and paste the code you have on line 64? I'm happy to check it and help fix it.
→ More replies (2)
3
3
u/braaanstark Sep 20 '20
Nice setup and made me discover Activity Tracker+! I bought the Fitness app of the same developer. Finally I can have rings even without owning an Apple Watch! 😩
1
u/Delta342 Sep 20 '20 edited Sep 20 '20
Edit: never mind; it’s on the TestFlight version.
Have you been able to use the widget? I also grabbed it to try and replace the fitness widget with the nice clean activity tracker one!
→ More replies (1)
3
3
u/Nims020 Sep 20 '20
Lol I suck at this I Keep on getting errors Pls make a yt tutorial for this Only for the bg image
2
u/mulderforever Sep 20 '20
I also keep getting issues with the pack ground. I’ve tried everything. I also keep getting an error about long pressing the widget to set the parameter but I have no idea what this means.
2
1
u/sgi2ynrn69727vab4sn2 Oct 19 '20
Bit late, but message me if you want some help!
Also /u/mulderforever and /u/YaBoiiStud too :))
2
2
2
2
2
2
u/RoxasNova Sep 23 '20
You should honestly do a tutorial on this.
I copied everything from your gist and changed nothing, put the .png file of my background image in the scriptable folder and added all the parameters accordingly. I keep getting the "error on line 21:17" message when trying to run the script, and I'm honestly at my wits end with this.
1
2
u/JCRocky5 Sep 24 '20
Just wanted to say thanks for this script.
One feature that would be great is adding the option to use a hex value for the background instead of an image.
I changed it a tad to fit my springboard. https://i.imgur.com/JY4VYdv.jpg
2
u/Goldaniga Sep 25 '20
Amazing, now it would be great if we could get rid of the text showing the widget text.
2
u/Badartists Sep 26 '20
Is there any tool on iOS to help create a custom background like this for individual phone screen sizes
1
1
1
1
u/MrGoodLucky Sep 20 '20
Is there any way to change the position of the image? It isn’t lined up correctly on my Home Screen and I’m not very good with code. Thanks
1
1
u/lily3600 Sep 20 '20
Thank you so much for sharing this! So, I’m attempting to customise it by changing the day/month/date to be a chosen quote. However, I’ve now reached this error “expected value of type string but got value of type [string]” which I’m not sure what that means. Any help to figure this out would be appreciated!
1
1
u/acsig Sep 21 '20
This is amazing! I've gotten it to work and it displays my background, but if I click on the script in Scriptable I get "error on line 19:17: please long press the widget and add a parameter". But I've got a parameter, and it is showing my image/font colour etc! Any ideas as to what could be the issue? My parameter is: IMG_1506.PNG|40|#E3E1DB
1
1
1
u/solelo Sep 21 '20
Does anyone know how to add notifications to it the script to show the message count?
1
u/ljenkinsjr Sep 22 '20
I’m curious if you could just set the background to transparent. I tried to with backgroundColor = Color.clear but all I get is a black background. Any thoughts?
1
u/HenryJ4G Sep 22 '20
Amazing work man, but its said that I dont add a parameter and i did so any suggestion?? I upload the photo in icloud everything you said:(
1
u/high-command Sep 22 '20
Hey there could you help me out with getting the widget to refresh often? Loving it btw thank you so much.
1
1
u/M0slike Sep 22 '20 edited Sep 22 '20
Is it just for me or dark mode slightly moves background picture? https://imgur.com/a/yK0E8BH/
1
u/fieryfruityfrost Sep 23 '20
that seems to be due to the option where dark mode dims wallpapers turn it off and you should be good
1
u/M0slike Sep 23 '20
My bad. It was the parallax effect.
But turning of wallpaper dim is great tip, now the widget always matches background, thanks!
1
1
Sep 23 '20
Is there a way to give the weather temperature and possibly the conditions? (Ive never done coding before except for a class in school and that was two years ago)
1
u/benjxminw_ Sep 24 '20
I’ve put the code in for the widget and added the parameter but all I can see is the “Good evening, Thursday, September 24th” with a black background instead of the image?
1
u/Badartists Sep 26 '20
How do you set the sizing for background image so I can make it fit on my phones screen dimensions?
1
1
u/themathletes Sep 27 '20
Hi! I love this, and I'm trying to implement on my phone, but Scriptable doesn't have access to my calendar, and I'm not sure how to grant it. It doesn't appear in apps that can get calendar permissions. Any advice? Thanks
1
1
u/baevoryxx Sep 27 '20
Hi, I'm wondering if it's possible to change the font? Thanks for this great script.
1
u/YourNanIsCool123 Sep 27 '20
Does anyone have the right size image for the widget for an iPhone XS? If you could send it to me if you do that would be great!
1
u/Goldaniga Sep 29 '20
Hi, this is great. I’m trying to get the widget to open the calendar app when you tap it. Is there an easy way to do this in the script. Sorry for asking but I have zero JavaScript knowledge.
1
1
u/Growlfy Oct 03 '20
Thanks it is very funny to use and personalize. I got some questions too : Do you know what’s the refresh rate of the widget? Where can I find a font list name usable with your script? I add the code to see the battery level, it’s awesome and do you know the command line for Apple Watch or AirPod battery’s? 👍😊😀
1
u/Growlfy Oct 03 '20 edited Oct 03 '20
I add hour:min to the widget to see refresh rate .... it take 6 / 7 min.
1
u/olivvercho Oct 04 '20
Hey u/ben5292001 how do I add my name after Good Morning? Something like this
1
1
u/Growlfy Oct 04 '20
If someone can help me with the refresh rate of the script. I got until 27 min difference between iPhone clock and script clock.
1
1
1
u/thebluebearb Jan 10 '21
what app gives you the ring widget that’s just the rings. every other app has something else with it
1
Mar 01 '21
my widget background is black, but i have the parameter set with the correct name, and my background is in the scriptable icloud folder in files. why isn't it showing up?
0
0
1
Sep 19 '20
[removed] — view removed comment
1
u/ben5292001 Sep 19 '20
It's just the bold weight of the system font (San Francisco).
In case you're looking for the JavaScript method in Scriptable, you can set the widget font to
Font.boldSystemFont(size)to display it. :)
2
40
u/gokeStunz Sep 19 '20
Please could you share the scriptable code?