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.
