68: Stephen Millard and ThoughtAsylum

3 Likes

Great episode! I immediately downloaded the IM-Icon Generator shortcut and put it to work. I modified it a bit to use notifications as status and progress updates, so I could know how far through the process it is. If anyoneā€™s interested, hereā€™s that modified version (hope thatā€™s okay to post here Stephen!)

https://www.icloud.com/shortcuts/aecc272d2d5246efbe47b60c60f77388

1 Like

Of course not :slightly_smiling_face: Iā€™m simply glad people are finding it useful.

For what itā€™s worth, I originally had some notifications in the shortcut to give an indication of progress. But it slowed things down and I didnā€™t get all that much benefit from knowing how far through processing it was or how much processing had been done (I gave it a try with percentage and a volmsof every 200). I couldnā€™t do anything with the information, it was just peace of mind I guess.

I ended up removing them as on my admittedly older devices(iPhone 8+ and an old 9.4" iPad Pro), speed was very much the critical factor to address the time outs I got. Itā€™s always a batch processing job and you need to give them a time window to run in. As a result I set them running and come back later.

1 Like

After hearing the episode I reread the thread old thread discussing an issue with you and realized I came off as a total jerk so apologies for that. You seem like a really nice guy and thanks for a great episode.

Yep, I figured you had considered all of this very carefully. I always struggle to find the balance of performance vs. verbosity. Itā€™s disappointing that doing a tiny amount of math slows down a Shortcut so much.

Inspired by @sylumerā€™s episode, after downloading ThoughtAsylum, I still could not find a simple action to strip any line numbering from the active draft, so I decided to write my own. For the first time, without starting from someone elseā€™s action, I wrote and then fixed about 10 errors to give me:

let theDraft = draft.content;
let lines = theDraft.split('\n');
let linesNum = lines.length;


for (let ix=0; ix < linesNum; ix++) {
lines[ix] = lines[ix].replace(/^\s*\d+\.\s+/,"");
 }

newContent = lines.join("\n");

draft.content = newContent;
draft.update();

I only share it here because it was the first time I was able to write a javascript action by myself, taking a million things Iā€™ve learned here over the years and put them to good use. Very satisfying! Thanks, @sylumer!

2 Likes

@sylumer Iā€™m attempting to run the Icon Generator on iOS 15 and I am prompted every few seconds to Allow "@IM-Icon-Generator" to save 1 image and 2,614 text items to a file? I select Always Allow every single time but it continues to prompt me. Is this a shortcuts bug? Or have you run into this before?

I havenā€™t run it myself for quite a while as I generated thousands enough to fit my uses right at the start, when I created it.

Someone else flagged something up on Twitter last night, so Iā€™m going to try and check how it is running on the latest versions this evening, once Iā€™m done with the day job and some volunteering efforts I have scheduled.

Iā€™ll let you know what I find and anything I come up with for any issues that may have surfaced through more recent OS/app updates.

2 Likes

Thanks so much! Iā€™m looking forward to getting it up and running to deck out my automations with some nice icons. Thanks for all of the work you do for the community!

Okay, I canā€™t reproduce that error. My permissions are already in place I would guess ā€¦ but I canā€™t tell for sure. Every time I now run the shortcut either on my iPad, or my iPhone (both are over three years old), it runs very slowly and then gives me an error:

image

First of all, I could see the generated Icons folder in iCloud Drive just sat in a waiting to upload state, so in case it was an iCloud sync issue, I tried switching to Airplane mode. No dice. No change in behaviour, and not a single image would be saved for me. Regardless of whether I select a single image or a group of images to generate.

Walking through the generation and adding in a quick look, I can see that (eventually), an image file is generated and the file name looks reasonable.No invalid characters. Progressing to the file saving step, that is where it now fails for me with the error above.

Could it be a file saving issue? Well, I created a new shortcut that simply used the same Toolbox Pro icon generation action and saved it to the same location using the same save step. That worked fine.

The situation is curious to say the least. I have another idea/theory I would like to put to the test, but it is rather late for me now (Iā€™m on UK time), and it will take me a little while to put together and investigate properly. So not something I can take a look at now. But, I will hopefully get a chance to take a stab at this tomorrow evening.

Wow! Awesome work. I started messing around with the shortcut and even duplicated it. I think that fixed the permissions problem but I also get the above error now.

Oddly enough though, I do actually have a few icons saved in the folder from when I had to manually give permission for each save. But now I canā€™t get the shortcut to replicate that process again.

@brandon, can you give this version a try?

It looks like my theory might have paid off, as it seems to be working again for me now on the current public release of Shortcuts/i*OS. Iā€™ve also tweaked it a bit in a couple of places too:

  1. Iā€™ve added in a bit more feedback when it is generating lots of icons.
  2. Iā€™ve change it to allow you to filter by groups (including ā€œallā€) when selecting to generate icons by name - which now allows for multi-select too.

https://www.icloud.com/shortcuts/18be7f09cc1c4b9598f71cc2c610cd27

I havenā€™t uploaded it to my website just yet as Iā€™d like to make sure this is working for others first. So if anyone else would like to give it a try and feedback, please do.

Thanks @sylumer! It was finally able to run. I still ran into the permissions error (image below) but after allowing 4 or 5 times the shortcut ran and was able to finish without any more input from me.

Thanks. Iā€™ve had feedback from one other that also had success with this version.

The permissions requests are built into Shortcuts, so thereā€™s nothing to do about that. They are there for security reasons and you will have to approve until Shortcuts gets the message - Shortcuts for me on 15.3.1 is still quite quirky sometimes.

I think this may be a Shortcuts bug. I havenā€™t run into it on this one, but another Shortcut I built that creates text files all of a sudden is asking for permission to save the file for every repeat in the loop on my Mac, but does not ask on my iPad.

I tried to run it and all I got at the end was one iconā€¦ then I realised (perhaps I missed an obvious step?) that by creating a folder called ā€˜Iconsā€™ then the shortcut worked away dumping all the icons into that folder!
thanks Stephen for such a brilliant shortcut!

1 Like

Thanks for flagging that up.

Iā€™ve had hundreds, if not thousands of people, download and use the Shortcut since I published it in late 2020. It was released as an example and no one ever highlighted that a prompt was required about the location - I had always assumed people would just set their own manuallyā€¦ and we all know what assumptions lead to :confounded:

Thatā€™s the third mention of this to me in the last two weeks, so thatā€™s a pattern in my book. I have some further tweaks Iā€™m considering, so Iā€™ll probably take another look and put out an update this weekend.

1 Like