NOTICE to users of JSJ's NIK scripts for 3rd party programs

Moderator: Kathy_9

Post Reply
JoeB
Posts: 2778
Joined: Fri Mar 28, 2008 10:04 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: LENOVO 4524PE4 ThinkCentre M91p
processor: 3.10 gigahertz Intel Quad Core i5-2400
ram: 8 GB
Hard_Drive_Capacity: 4.6 TB
Corel programs: PSP 9, X7 to 2019, 32 & 64-bit
Location: Canada

NOTICE to users of JSJ's NIK scripts for 3rd party programs

Post by JoeB »

I, and a few others, have modified JSJ's scripts - originally intended to open NIK standalone filters when the plugin wouldn't work with PSPX6 - to open other 3rd party programs as plugins from within PSP. It works fine when there is only one image open in PSP's workspace. But I found a glitch - at least for me and perhaps others. It is correctable if you have the same issue.

The problem I ran into was when I had more than one image open in PSP's workspace. Depending on which image I put into focus to run a third party program on (for example, Aurora HDR), I got some unexpected results, such as one image being closed and replaced by the processed image returned by Aurora, and another image getting a copy of the unprocessed image placed on it as a layer. Weird! If my tests - and fix - are correct, it's because when there are several open images the script gets confused as to what to do with which particular open image. It doesn't necessarily act only with the processed image returned by the third party program and the image that was in focus when the script was run.

A simple edit to the script will fix it if you have the same issue. Below is a portion of the script that begins at around line 106 (it can vary a bit depending on what edits you have made further up the script). You'll see that SelectImage underneath SelectDocument AND SelectImage under CopyImage (which I have bolded below) are followed by the number 1. You just have to change those 1's to a zero to make the script act on the document in focus. DO NOT change the number 1 in the 3rd Environment (FileClose) which closes the temp file the script uses.

App.Do( Environment, 'SelectDocument', {
'SelectedImage': 1,
'Strict': False,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Silent,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((14,0,0),1)
}
})

App.Do( Environment, 'CopyImage', {
'SelectedImage': 1,
'Strict': False,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Silent,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((14,0,0),1)
}
})

App.Do( Environment, 'FileClose', {
'SelectedImage': 1,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Silent,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((14,0,0),1)
}
})

If the fix doesn't work for you (it works for me with the several scripts I use to open 3rd party standalone filters) then please post back and we'll ask the actual forum script guru to help you! :-)

I posted this also in the main PSP forum so that those using the script who don't visit Scripting might see it also.

A SIDE NOTE: For those who want to use PSP2018 64bit but still have access to the 32bit plugins that only work with 32bit PSP, if you have a previous 32bit PSP (like X9), then the script can be used to open that PSP version with a copy of the visible layer in PSP 2018 64bit, and you can apply your 32bit plugin there, save the file, close the 32bit PSP and get the processed image back as a layer on your image in PSP 2018 64bit. That gives you the advantage of the speed and memory optimization of 64bit PSP for most of your work. I decided to go that route. Just a thought.
Regards,

JoeB
Using PSP 2019 64bit
Post Reply