-
Notifications
You must be signed in to change notification settings - Fork 101
Conversation
@joshfarrant One thing I don't see any examples of how we handle "Ask When Run" parameter values. Any thoughts? I see there's an |
My fault, I didn't add any concrete example since my work on the variables in still in progress (#14). You can use those global variables like this: const {
askWhenRun,
clipboard,
} = require('@joshfarrant/shortcuts-js/variables');
const actions = [
text({
text: withVariables`I need ${askWhenRun} cups of ${clipboard} ☕️`
}),
]; Or, if you have a local copy of the git: const {
askWhenRun,
clipboard,
} = require('./build/variables'); |
Great! Thanks so much, @xAlien95! |
@xAlien95, quick follow-up: what would I do in situations where “Ask When Run” is part of an option set? |
@bachya, you have to add const getDeviceDetails = (
options: {
/** The particular detail to retrieve */
detail?: WFDeviceDetail | WFSerialization,
},
): WFWorkflowAction => {
const {
detail = 'Device Name',
} = options;
return {
WFWorkflowActionIdentifier: 'is.workflow.actions.getdevicedetails',
WFWorkflowActionParameters: {
WFDeviceDetail: detail,
},
};
}; Take a look at |
f39826f
to
86ba90c
Compare
@xAlien95 I believe I added support correctly, but, inexperienced as I am, I can't seem to test it successfully (i.e., I can't establish what code produces a shortcut that actually uses "Ask When Run" in this case). Please correct me where I'm wrong! |
@bachya, thanks for looking into it. I added some comments to let you separate
At the moment If you want to test now your action with getDeviceDetails({
detail: {
Value: askWhenRun,
WFSerializationType: 'WFTextTokenAttachment',
},
}) In the future, you'll just have to write: getDeviceDetails({
detail: askWhenRun,
}) |
This reverts commit 665f21a.
Thanks both, looks good 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one tiny tweak then we're good to go 👍
Checks
Added Actions (if relevant)
Get Device Details
Are you happy to be listed as a contributor on Shortcuts.fun?
Yes
Any other information / comments
N/A