sindresorhus / Actions

⚙️ Supercharge your shortcuts
https://sindresorhus.com/actions
MIT License
2.58k stars 109 forks source link

Action proposal: Boolian Variables #137

Closed hutonahill closed 1 year ago

hutonahill commented 1 year ago

Description

For some reason, Shortcuts doesn't have Boolean variables. I don't know why. I am currently reduced to storing a true and a false in datajar and calling those whenever I need a bool. However, this is not ideal as it's easy to miss spell the key on my dinky iPhone keyboard. I would want two functions. one that returns true, and one that returns false.

hutonahill commented 1 year ago

it's very possible that I am an idiot and apple already does this.

jsiegenthaler commented 1 year ago

You can create a Boolean variable easily. Use a Set Variable action and make sure you are passing a Boolean value. Example: Text with value of 1 Set Variable boolName to Text. Tap the Text variable name and set type to Boolean. Use Quicklook to show the output. It will now be Yes if the text is 1, or No of the text is 0. Anything >=1 is true, anything <1 is false