We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The setBrightness action doesn't assign the correct value type for shortcuts to handle.
Shortcuts-JS assigns a value type of <integer> where the native Shortcuts App assigns <real>.
<integer>
<real>
Here is an example of the generated shortcut file using Shortcuts-JS:
<array> <dict> <key>WFWorkflowActionIdentifier</key> <string>is.workflow.actions.setbrightness</string> <key>WFWorkflowActionParameters</key> <dict> <key>WFBrightness</key> <integer>88</integer> </dict> </dict> </array>
And this from the native Shortcuts App:
<array> <dict> <key>WFWorkflowActionIdentifier</key> <string>is.workflow.actions.setbrightness</string> <key>WFWorkflowActionParameters</key> <dict> <key>WFBrightness</key> <real>0.8868458271026611</real> </dict> </dict> </array>
Building a shortcut using the below code sets the brightness to 100 when loaded into the app.
const fs = require("fs"); const { buildShortcut } = require("@joshfarrant/shortcuts-js"); const { setBrightness } = require("@joshfarrant/shortcuts-js/actions"); const actions = [ setBrightness({ brightness: 25 }) ]; const shortcut = buildShortcut(actions); fs.writeFile("Brightness.shortcut", shortcut, err => { if (err) { console.error("Something went wrong :(", err); return; } console.log("Shortcut created!"); });
The text was updated successfully, but these errors were encountered:
Good spot, thanks. Hopefully bplist-creator supports <real>s, if so it should be an easy fix.
bplist-creator
I’ll take a look in the morning (if no-one else wants to in the meantime).
Sorry, something went wrong.
Thanks for the fix 👍
No branches or pull requests
The setBrightness action doesn't assign the correct value type for shortcuts to handle.
Shortcuts-JS assigns a value type of
<integer>
where the native Shortcuts App assigns<real>
.Here is an example of the generated shortcut file using Shortcuts-JS:
And this from the native Shortcuts App:
Building a shortcut using the below code sets the brightness to 100 when loaded into the app.
The text was updated successfully, but these errors were encountered: