SOLVED: Script Editor problem with one script only!

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

SOLVED: Script Editor problem with one script only!

Post by JoeB »

With any version of PSP from X7 to 2018, I can used the Edit Selected Script button to open my editor of choice and edit any script EXCEPT one of them.

First, let me stress that the problem script (one of mine posted in this sub-forum) works just fine when run, just as advertised. That's why I'm posting this in a separate thread - i.e., so as not to leave the impression in the thread where it is posted that the script itself doesn't work properly. So now the problem.

The script (Rounded Rectangle_Adjust Corners - link below) runs when I run it. However, if I have it as the selected script and click the Edit Selected Script button it freezes all of the above versions of PSP and I have to close it using Task Manager. This happens whether I have Notepad++ OR Editpad Lite as my chosen editor. This does not happen with any of the other multiple scripts I have, including those which use Gary Barton's Pause script as this one does. EDIT: The script opens fine for editing if opened directly in any text editor instead of through PSP.

So I was hoping some person(s) might download the script from the link below and let me know if, attempting to open it in PSP using the Edit Selected Script button (where you have already selected an external editor of choice using File>Preferences>File Locations) it opens as it should for editing or if it freezes your version of PSP. If it does open for editing for you, could you let me know which editor you are using as your selected editor. This single anomaly with this single script (which otherwise runs fine) is driving me nuts! :-)

Thanks in advance for any assistance.
Attachments
Rounded Rectangle_Adjust Corners.zip
Problem opening script in PSP for editing.
(3.71 KiB) Downloaded 181 times
Last edited by JoeB on Sat Oct 14, 2017 11:10 pm, edited 2 times in total.
Regards,

JoeB
Using PSP 2019 64bit
Kathy_9
Site Admin
Posts: 2896
Joined: Tue Nov 30, 2010 12:44 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
processor: 8th Generation Intel Core i7 8700 3 20 GHz
ram: 16GB
Video Card: NVIDIA GeForce RTX 2060 [6 GB GDDR6 dedicated]
sound_card: NVIDIA High Definition Audio
Hard_Drive_Capacity: 2TB
Monitor/Display Make & Model: HP EliteDisplay E243m 23.8-inch
Corel programs: PSPX2 ~2023; Painter 2018~23
Location: USA
Contact:

Re: Scirpt Editor problem with one script only!

Post by Kathy_9 »

Joe,

I can confirm your results. Both PSP X9 and PSP 2018 froze when trying to use the script editor button with that particular script selected. I had to close both X9 and 2018 via the task manager.

Regards,
Kathy
PSPX9 | PSP2020 | PSP2021| PSP2022 | PSP2023 & PhotoMirage installed; PSPX | PSPX2 thru PSP2019 owned but not installed
http://www.flickr.com/photos/37153430@N03/
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: Scirpt Editor problem with one script only!

Post by JoeB »

Thanks for the feedback, Kathy. The problem now is to figure out why. I have tried several code edits of the script (e.g., making sure tabs were replaced with spaces, etc.,) but haven't been able to identify what the issue is. Hopefully a script guru like LeviFiction will try this out and come up with the solution. However, as the script runs properly on all versions of PSP I can't see where it is a coding issue. And the script opens fine in both Notepad++ and Editpad Lite when opened directly in those programs rather than through PSP.
Regards,

JoeB
Using PSP 2019 64bit
LeviFiction
Advisor
Posts: 6831
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Alienware M17xR4
processor: Intel Core i7-3630QM CPU - 2_40GH
ram: 6 GB
Video Card: NVIDIA GeForce GTX 660M
sound_card: Sound Blaster Recon3Di
Hard_Drive_Capacity: 500GB
Corel programs: PSP: 8-2023
Location: USA

Re: Scirpt Editor problem with one script only!

Post by LeviFiction »

For unknown reasons PSP hates the """multiline string""" portion. It'll run it, but the internal editor appears to get stuck in a loop so it'll never even attempt to open the external editor.

Easy enough fix, just use Python's other multiline string option of adding a "\" after the end of each string. Demonstrated below.

Code: Select all

def ScriptProperties():
    return {
        'Author': 'JoeB with input from LeviFiction',
        'Copyright': u'Can be distributed for free and/or edited to taste',
        'Description': u"Creates a rounded rectangle selection on an"\
        "image where you can adjust size of the corner curves and the size and"\
        "position of the rectangle and then copies the selected image portion"\
        "and pastes it as a new image",
        'Host': u'PaintShop Pro',
        'Host Version': u'8.00'
        }
https://levifiction.wordpress.com/
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: Scirpt Editor problem with one script only!

Post by JoeB »

Thanks Levi - that did the trick! And I learned something new. :-)

Although, now that I think of it, it's funny that PSP will run the script like that but freeze when opening it in the editor. :?
Regards,

JoeB
Using PSP 2019 64bit
Post Reply