Learning Shortcuts

Just to set a baseline, I edited my Fibonacci shortcut to exclude any optimizations. The timing result was 130 milliseconds, which is only a bit slower than the two-shortcut solution. I guess the bottom line is to test and use whatever works best.

Get Fibonacci Number.shortcut (22.8 KB)

Another optimization approach is to limit the number of repeat loops to the exact number required. Google AI provided a formula that works with my Fibonacci shortcut, and the timing results (in milliseconds) are shown below. The new shortcut is not limited in the size of the maximum number.

Max Number Old Shortcut New Shortcut
10 126 42
100 127 64
1000 127 85
10000 126 105
100000 127 125
1000000 127 140

The following screenshot only shows a portion of the shortcut.

Get Fibonacci Number.shortcut (22.9 KB)

I rewrote the shortcut mentioned above to use a Text action instead of a Dictionary action to store the window data (position and size). This isn’t any faster but seems a simpler approach to enter the window data.

App Arrange.shortcut (24.0 KB)

The following is a helper shortcut that can be used to get the window data for use in the App Arrange shortcut. For a simple task, it does too much, but I wanted to test solutions to a few items (like the off-center stuff).

App Arrange Helper.shortcut (25.1 KB)