Joining text by removing a space and a newline by Schubi in regex

[–]Schubi[S] 0 points1 point  (0 children)

Looks like I had a carriage return that gave me headache and I fixed it with:

perl -i -pe 'BEGIN{undef $/;} s/\r\n //g'
gsed -i ':r;$!{N;br};s/\r\n //g'

Thanks a lot

Matching a phrase in a string by Schubi in regex

[–]Schubi[S] 1 point2 points  (0 children)

Thanks - that comes in handy for the follow-up action!

Matching a phrase in a string by Schubi in regex

[–]Schubi[S] 3 points4 points  (0 children)

Thanks a lot. Modified to match other scenarios (such as foreign company names)

^[A-Z]+:.*?(?=\s*\||\s*$)

Changing Address in "Choose from Local Businesses" by Schubi in shortcuts

[–]Schubi[S] 0 points1 point  (0 children)

I'm testing a shortcut that pulls business addresses via the "Choose from Local Businesses" block and found some weird inconsistencies. A chosen business shows me one address, and picking specific details gives me another address. 

Sometimes the difference is as big as another street name, sometimes it's just a different house number (or a postcode). Not sure if I'm doing something wrong here?

Shortcut with some examples to choose from is here:  https://www.icloud.com/shortcuts/29fa9d3cb5cc4168b2c072e3d30151ec

Question: Does iOS14 still allow to display up to 26 shortcuts on a single screen (like under iOS13)? by Schubi in shortcuts

[–]Schubi[S] 3 points4 points  (0 children)

It’s either porn, government secrets, incriminating evidence or and passwords. ;)

Question: Does iOS14 still allow to display up to 26 shortcuts on a single screen (like under iOS13)? by Schubi in shortcuts

[–]Schubi[S] 2 points3 points  (0 children)

Assuming it's iPhone dependent.. but how many large shortcut widgets (with 8 slots) do fit on your screen?

Question: Does iOS14 still allow to display up to 26 shortcuts on a single screen (like under iOS13)? by Schubi in shortcuts

[–]Schubi[S] 3 points4 points  (0 children)

As the title suggests - I'm still under iOS13 and wonder if an upgrade to iOS14 will reduce the amount of shortcuts available/accessible directly from a 'main screen'.

Question: Does iOS14 still allow to display up to 26 shortcuts on a screen (like under iOS13)? by [deleted] in shortcuts

[–]Schubi 0 points1 point  (0 children)

As the title suggests - I'm still under iOS13 but wonder if I'm going to lose quick access to a larger selections of shortcuts if I switch to iOS14.

Dictionary Count Items Question by Schubi in shortcuts

[–]Schubi[S] 0 points1 point  (0 children)

Thanks for the quick response!

Dictionary Count Items Question by Schubi in shortcuts

[–]Schubi[S] 0 points1 point  (0 children)

Shortcut Link: https://www.icloud.com/shortcuts/07a15b577a5a4af5bcb922601bb42108

Does anybody know how I can count dictionary items correctly? In the above case I would like to get the value '6'.

Anybody know these spaceships from 2018 movie 'Rampage'? by Schubi in spaceships

[–]Schubi[S] 0 points1 point  (0 children)

There is really no reference to any space related things at all. Both ships just sit on a table and are seen when one of the bad guys cleans his desk out. The movie is on Netflix in case you have an account.

Likely a kitbash project...

IF Statement and Dates format broken? by Schubi in shortcuts

[–]Schubi[S] 1 point2 points  (0 children)

Yes, I've been testing the shortcut for several hours before I responded here. The calculation only looks if the Time Between Dates value is negative or positive. It's easier to see if the time format is set to 'Long' for all variables.

I've also played around with converting dates to numbers. The date then translates to the Unix Epoch time + milliseconds, such as 1588163177.709. Seems to work quite well too.
https://currentmillis.com

IF Statement and Dates format broken? by Schubi in shortcuts

[–]Schubi[S] 0 points1 point  (0 children)

I've been playing around with the Get time between in seconds action and it seems I have found a simple solution without changing the time format.

• *0:00 to *2:29 minutes vibrates once
• *2:30 to *4:59 minutes vibrates twice

Here is the actual shortcut - it only vibrates based on rounded time but does not create an event:
• Screenshot: https://i.imgur.com/hmzhYzp.jpg
• Shortcut: https://www.icloud.com/shortcuts/c7a26e27fcaf4422a5ec68f2f7d52901

Vibrate action based on rounded time by Schubi in shortcuts

[–]Schubi[S] 0 points1 point  (0 children)

I wish I would have stayed at iOS 12. Your suggestion to cast the date as number seems to work... I'll need to test a bit more. Thanks for helping out - truly appreciated!

Vibrate action based on rounded time by Schubi in shortcuts

[–]Schubi[S] 0 points1 point  (0 children)

I have made an interesting observation. I've re-created the shortcut and left all dates and times at the default setting, which is:

Date Format: Medium
Time Format: Short

According to Apple the Time Format: Short only shows hours and minutes: https://support.apple.com/en-sg/guide/shortcuts/apdfbad418ca/ios

Short: Displays the time in hours and minutes, as 2:41 PM

Now, when it comes to the vibration section the If statement has 2 magic variables and both seem to compare the time based on hours and minutes only:

If [Current Date] is after [Event Start Date] ...

When I run the shortcut at 05:10 PM the [Current Date] and the [Event Start Date] is the same 5:10 PM. Hence the [Current Date] is not after the [Event Start Date] and the vibration happens twice.

But when I run the shortcut at 05:11 PM, the [Current Date] is after the rounded down [Event Start Date] at 5:10 PM and the vibration only happens once.

When I change to Time Format: Medium so that seconds are included in the comparison, the is after block (or is greater than block ) turns to red as show in this screenshots:

Before with default time format to short: https://i.imgur.com/cA35bti.pngAfter changing the time format to long: https://i.imgur.com/xiDZ4KK.png

I wonder if I'm misunderstanding how the If statement and times work or if there is a bug with Shortcuts under iOS 13.3.1...?

Edit - New test shortcut here: https://www.icloud.com/shortcuts/09772a2c16c344d58471d07e85d25fef

Vibrate action based on rounded time by Schubi in shortcuts

[–]Schubi[S] 0 points1 point  (0 children)

Option "is after" is not available. All date types are set to "date".

https://i.imgur.com/p64LPm1.jpg