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

Corel Paint Shop Pro

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 PSPX4 - 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'll be posting this also in the Scripting forum so that Ken doesn't have to copy it there.

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
User avatar
Ken Berry
Site Admin
Posts: 22481
Joined: Fri Dec 10, 2004 9:36 pm
operating_system: Windows 11
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Gigabyte B550M DS3H AC
processor: AMD Ryzen 9 5900X
ram: 32 GB DDR4
Video Card: AMD RX 6600 XT
Hard_Drive_Capacity: 1 TB SSD + 2 TB HDD
Monitor/Display Make & Model: Kogan 32" 4K 3840 x 2160
Corel programs: VS2022; PSP2023; DRAW2021; Painter 2022
Location: Levin, New Zealand

Re: NOTICE to users of JSJ's NIK scripts for 3rd party progr

Post by Ken Berry »

Joes -- just wondering why you didn't post this in the Scripting sub-forum... and whether you want me to move it there?
Ken Berry
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

Re: NOTICE to users of JSJ's NIK scripts for 3rd party progr

Post by JoeB »

Ken Berry wrote:Joes -- just wondering why you didn't post this in the Scripting sub-forum... and whether you want me to move it there?
I did post it there Ken, as I said in this post I would. It's in both forums because I know there has been some discussion here also about those scripts and some users might have them but not visit the Scripting sub-forum.
Regards,

JoeB
Using PSP 2019 64bit
User avatar
Ken Berry
Site Admin
Posts: 22481
Joined: Fri Dec 10, 2004 9:36 pm
operating_system: Windows 11
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Gigabyte B550M DS3H AC
processor: AMD Ryzen 9 5900X
ram: 32 GB DDR4
Video Card: AMD RX 6600 XT
Hard_Drive_Capacity: 1 TB SSD + 2 TB HDD
Monitor/Display Make & Model: Kogan 32" 4K 3840 x 2160
Corel programs: VS2022; PSP2023; DRAW2021; Painter 2022
Location: Levin, New Zealand

Re: NOTICE to users of JSJ's NIK scripts for 3rd party progr

Post by Ken Berry »

Ah -- sorry. I didn't read all of the original post since I don't use scripts myself! :oops:
Ken Berry
Post Reply