Creating a script for applying Neural Filters. But I want to use parameters in code.
It works fine if I create an Action. I can convert the Action to javascript. Runs generated script and runs fine.
It works fine if I use the scriptlistener. Runs generated script and runs fine.
If I change the scripts at the obvious parameters, Age, Style brush size it does not refresh with the different parameters. In fact it uses the original script ones. However if I open the neural filter, the changed parameters are there and it refreshs and I press OK, then fine.
Thing is, comparing the generated scripts when just one parameter, say Age has changed, there is a difference in a hextobin unintelligible code, some random numbers, as well as the obvious variable.
So if the answer is obvious sorry, this is my first PS script (I do code AE).
App.refresh(); didn't force the filter to refresh, is there another way?
Any thoughts and thanks.
Changing Neural Filter by script not working/refreshing.
-
- Posts: 1
- Joined: Tue Oct 27, 2020 10:58 pm
-
- Posts: 1
- Joined: Fri Nov 19, 2021 10:34 am
Re: Changing Neural Filter by script not working/refreshing.
When you change the parameters in the script, are you updating the correct variable names and values in the code?TiggertheT wrote: ↑Wed Oct 28, 2020 8:45 am Creating a script for applying Neural Filters. But I want to use parameters in code.
It works fine if I create an Action. I can convert the Action to javascript. Runs generated script and runs fine.
It works fine if I use the scriptlistener. Runs generated script and runs fine.
If I change the scripts at the obvious parameters, Age, Style brush size it does not refresh with the different parameters. In fact it uses the original script ones. However if I open the neural filter, the changed parameters are there and it refreshs and I press OK, then fine.
Thing is, comparing the generated scripts when just one parameter, say Age has changed, there is a difference in a hextobin unintelligible code, some random numbers, as well as the obvious variable.
So if the answer is obvious sorry, this is my first PS script (I do code AE).
App.refresh(); didn't force the filter to refresh, is there another way?
Any thoughts and thanks.
One solution could be to create a function that takes in the parameters as arguments and generates the script based on those values. This way, the script will always be generated with the correct parameters.
Another solution could be to use the executeAction() method instead of App.refresh(). This method allows you to run an action with specific parameters. You can create an action with the desired Neural Filters and parameters, save it, and then use executeAction() to run the action with the updated parameters.
Here's an example of how you can use executeAction():
Code: Select all
var idNS = charIDToTypeID("NS ");
var action = stringIDToTypeID("AdobeScriptAutomation Scripts");
var filter = stringIDToTypeID("neuralFilter");
var desc = new ActionDescriptor();
desc.putString(stringIDToTypeID("preset"), "Age");
desc.putInteger(stringIDToTypeID("value"), 20);
var ref = new ActionReference();
ref.putEnumerated(action, filter, stringIDToTypeID("neuralFilter"));
executeAction(ref, desc, DialogModes.NO);
Last edited by Lucas brown on Thu May 30, 2024 7:30 am, edited 1 time in total.
Re: Changing Neural Filter by script not working/refreshing.
You 'refreshed' old thread to advertise the (linked) product. You did not understand the problem of author (since you didn't refer to curprit of problem, that is 'hextobin unintelligible code'). There are some other omissions. I think you (as most likely trained bot) used chatGPT to auto create your answer, all the more, you quoted original poster content (although it's obvious who you answer to). If you are not a bot, have you used chatGPT?