Hello,
Is it possible in a JS script to tick/untick optional steps of an action in the Actions palette before the script runs the action? Scriptlistener doesn't record this.
Here is my scenario:
* Action1 comprises several steps; these steps are rather "variants" of the same processing (setting the opacity of a layer), and only one "step" is ticked in the actions palette.
* Action1 is called by Action2 (this is one of the steps of Action2, not the last one).
* I would like my script to be able to tick one of the steps of Action1, and untick all its other steps, before running Action2, which will itself call Action1.
Theoretically, I could duplicate Action1, modify the duplicate (untick the steps I don't need), and run the original or the duplicate. Things are a little more complicated in my case, because Action1 is itself called by Action2, so Action2 would have to know which version of Action1 to call.
(Un)tick action steps in the Actions palette
(Un)tick action steps in the Actions palette
I don't think that the script can uncheck the steps. Another approach is to break the steps in Actioin1 into seperate actions, one for each step. Then break Action2 into 2 actions. The steps before it call Action1 and the steps after. Then have your script do Action2a, the action that has the wanted step from Action1 and then Action2.
Or you could just write the whole thing as a script. I'm not sure from you post how the script would choose which step to run/uncheck
Mike
Or you could just write the whole thing as a script. I'm not sure from you post how the script would choose which step to run/uncheck
Mike
(Un)tick action steps in the Actions palette
Mike Hale wrote:Or you could just write the whole thing as a script. I'm not sure from you post how the script would choose which step to run/uncheck
Translate the Actions to javascript (see XToolkit). Change the Action A function so that it has a property, specifically an array of boolean values, one for each step. Change the Action A so that it checks that array to determine which steps to execute.
There are probably other ways to tackle the problem besides this one.
I can work up an example if you're interested.
Translate the Actions to javascript (see XToolkit). Change the Action A function so that it has a property, specifically an array of boolean values, one for each step. Change the Action A so that it checks that array to determine which steps to execute.
There are probably other ways to tackle the problem besides this one.
I can work up an example if you're interested.
(Un)tick action steps in the Actions palette
Mike Hale wrote:I don't think that the script can uncheck the steps. Another approach is to break the steps in Actioin1 into seperate actions, one for each step. Then break Action2 into 2 actions. The steps before it call Action1 and the steps after. Then have your script do Action2a, the action that has the wanted step from Action1 and then Action2.
Or you could just write the whole thing as a script.
Mike, thanks for your reply. Breaking the actions into discrete actions will be complicated. I guess the best approach is the second one you suggest: write the whole thing as a script. I was hoping to avoid doing this, because my scripting experience (and the time available!) are rather limited I'll try, this may be a valuable learning experience.
Mike Hale wrote:I'm not sure from you post how the script would choose which step to run/uncheck
I display a dialog window,with various options selectable by checkboxes and sliders, and a "Run" push button.
Or you could just write the whole thing as a script.
Mike, thanks for your reply. Breaking the actions into discrete actions will be complicated. I guess the best approach is the second one you suggest: write the whole thing as a script. I was hoping to avoid doing this, because my scripting experience (and the time available!) are rather limited I'll try, this may be a valuable learning experience.
Mike Hale wrote:I'm not sure from you post how the script would choose which step to run/uncheck
I display a dialog window,with various options selectable by checkboxes and sliders, and a "Run" push button.
(Un)tick action steps in the Actions palette
xbytor wrote:Translate the Actions to javascript (see XToolkit).
Were can I download XToolkit? I have seen it mentioned while browsing the Beta-testing forum, is there a "release" version?
xbytor wrote:Change the Action A function so that it has a property, specifically an array of boolean values, one for each step. Change the Action A so that it checks that array to determine which steps to execute.
There are probably other ways to tackle the problem besides this one.
I can work up an example if you're interested.
I guess in my case a simple integer or string parameter would do, since all the steps are exclusive of each other? But if you have an example of your suggestion I would be interested anyway.
Thanks for your reply!
Were can I download XToolkit? I have seen it mentioned while browsing the Beta-testing forum, is there a "release" version?
xbytor wrote:Change the Action A function so that it has a property, specifically an array of boolean values, one for each step. Change the Action A so that it checks that array to determine which steps to execute.
There are probably other ways to tackle the problem besides this one.
I can work up an example if you're interested.
I guess in my case a simple integer or string parameter would do, since all the steps are exclusive of each other? But if you have an example of your suggestion I would be interested anyway.
Thanks for your reply!
(Un)tick action steps in the Actions palette
XTookit is here: http://ps-scripts.com/bb/viewtopic.php?t=276 and is just finishing its beta cycle. I'll be pushing the v1.0 release this weekend.
I'll take a quick pass at getting an example of what I'm talking about implemented tomorrow.
I'll take a quick pass at getting an example of what I'm talking about implemented tomorrow.
(Un)tick action steps in the Actions palette
bcf wrote:Mike Hale wrote:I'm not sure from you post how the script would choose which step to run/uncheck
I display a dialog window,with various options selectable by checkboxes and sliders, and a "Run" push button.
Maybe I'm missing something here, but how is checking which steps to run in the script UI better than checking the steps in the action palette?
I display a dialog window,with various options selectable by checkboxes and sliders, and a "Run" push button.
Maybe I'm missing something here, but how is checking which steps to run in the script UI better than checking the steps in the action palette?
(Un)tick action steps in the Actions palette
Mike Hale wrote:Maybe I'm missing something here, but how is checking which steps to run in the script UI better than checking the steps in the action palette?
It forces them to have one and only one step (out of some subset) checked?
It forces them to have one and only one step (out of some subset) checked?
(Un)tick action steps in the Actions palette
There is that, I knew I had to be missing the point.