Pro+: passing preset name to plugin in CS2 script

questions about practical use of Neat Image
Post Reply
giuse
Posts: 10
Joined: Wed Dec 27, 2006 7:00 pm

Pro+: passing preset name to plugin in CS2 script

Post by giuse »

Hi, I tried to pass a preset name from a CS2 javascript to NI plugin without any success: the plugin just uses the default preset (if set to use a preset) or the auto-matched preset (but not the one I want :? )....

Since my script is making calculations to decide which preset to use, should I create as many actions as many presets I have :?:

Why is it not possible to send parameters to NI plugin (preset but also for example tuning of the parameters)? It'd be quite useful.

Thanks a lot,

Giuse
===================
Btw, the CS2 Javascript dump from using NI plugin is the following:
-----------
var id82 = stringIDToTypeID( "d9543b0c-3c91-11d4-97bc-acb0d0204936" );
var desc15 = new ActionDescriptor();
var id83 = charIDToTypeID( "SfpN" );
desc15.putString( id83, "Auto match profile and Auto fine-tune" );
var id84 = charIDToTypeID( "SrpN" );
desc15.putString( id84, "Default.nfp" );
var id85 = charIDToTypeID( "FfpN" );
desc15.putString( id85, "C:\Program Files\Neat Image\PLUGIN\RecentProfile.dnp" );
var id86 = charIDToTypeID( "FrpN" );
desc15.putString( id86, "C:\Program Files\Neat Image\PRESETS\Default.nfp" );
var id87 = charIDToTypeID( "BpaN" );
desc15.putBoolean( id87, false );
var id88 = charIDToTypeID( "BmaN" );
desc15.putBoolean( id88, true );
var id89 = charIDToTypeID( "BfaN" );
desc15.putBoolean( id89, true );
var id90 = charIDToTypeID( "BsaN" );
desc15.putBoolean( id90, false );
-----------
I thought I could use these interesting parameters to control the behavior of the plugin, but so far I couldn't.. any help? Thx
NITeam
Posts: 3173
Joined: Sat Feb 01, 2003 4:43 pm
Contact:

Post by NITeam »

In another topic you asked about action support in the plug-in and the problem there was opening the plug-in windows when running an action. Perhaps the same thing is causing the problem here?

Vlad
giuse
Posts: 10
Joined: Wed Dec 27, 2006 7:00 pm

Post by giuse »

Hi Vlad, first of all thanks for your very responsive feedback :D

Yes, the two threads are related: I am trying to invoke NI by a javascript with different presets based on calculations made in the script itself.

Firstly I tried passing parameters (this thread) but to me it does not seem to work. Should it be possible?
Then (this thread), I tried creating different actions with different used presets so that the script invokes different actions (instead of same action with different parameter -this thread-) but with dialog enabled, it didnt seem to work as well.

cheers

Giuse
NITeam
Posts: 3173
Joined: Sat Feb 01, 2003 4:43 pm
Contact:

Post by NITeam »

It should be possible since Photoshop can do that just fine using its action mechanism.

I suggest the following plan:

1. please try to use the plug-in in Photoshop in actions to make sure everything works as it should with different action settings and you have several sample actions that you can use as working samples;

2. try to run the same actions (the same parameters) from within your scripts to make sure that everything works the same way it worked in step 1.

3. try to modify some of the parameters in a working action using your script, for example, modify the path to the filter preset that should be used ("FrpN").

I hope this will help you start using the plug-in in Javascripts.

Vlad
giuse
Posts: 10
Joined: Wed Dec 27, 2006 7:00 pm

Post by giuse »

Thanks. I will try.
Recording an action I found the following parameters:

1 ) "SfpN" = policy to select the profile (I will use "Auto match profile and Auto fine-tune")

2 ) "SrpN" = Noise Preset (passed from javascript), correct?

3 ) "FfpN" = seems to be always "C:\Program Files\Neat Image\PLUGIN\RecentProfile.dnp" );

4 ) "FrpN" = seems to be the preset again with full path, correct?

5 ) "BpaN" = what is it? always seems to be false

6 ) "BmaN" = what is it? I found it sometimes false, other times true.

7 ) "BfaN" = what is it? Found always false so far.

8 ) "BsaN" = what is it? Found always false so far.

Maybe these values could be documented in the manual for easier integration with CS2?
Thanks a lot,

Giuse
Post Reply