PSPX8 broke X7 and previous script

Moderator: Kathy_9

Post Reply
corelProps
Posts: 3
Joined: Sat Feb 27, 2016 5:39 am
operating_system: Windows 7 Professional
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSPX8

PSPX8 broke X7 and previous script

Post by corelProps »

I've been using the following portion in my script since I believe X3.

Code: Select all

 App.Do( Environment, 'JPEGOptimizer', {
	    'Format': App.Constants.JpegFormat.Standard,
	    'Compression': 20,
	    'FileName': App.ActiveDocument.Title,
	})
X8 is choking on the App.ActiveDocument part. Is the App.ActiveDocument object not used any more?

Also, the only reference to updated X8 script API is listed in this thread:
http://forum.corel.com/EN/viewtopic.php?f=104&t=56846

It requires an install. Is there anything like a website, archive of files, or single document with all the latest PSPscript changes that doesn't require an install?
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: PSPX8 broke X7 and previous script

Post by LeviFiction »

It's an installer, but it only puts a scripting folder in your Documents. Nothing else.

And no, X8 does use ActiveDocument still.

I'm actually a little surprised to hear App.ActiveDocument.Title worked that well. Title uses the text in the titlebar of the image. So on images loaded into PSP already that will be the full image name and extension but no path, and on brand new images there will be no extension. So it should only work on JPGs that were loaded into PSP from the harddrive and nothing else.

It also will always use the last saved directory, because no path is given, so if the image you're using the script on was saved somewhere else it'll end up in a different place on the harddrive.

Anyway, could you give us the exact error that is given when the script fails?
https://levifiction.wordpress.com/
corelProps
Posts: 3
Joined: Sat Feb 27, 2016 5:39 am
operating_system: Windows 7 Professional
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSPX8

Re: PSPX8 broke X7 and previous script

Post by corelProps »

I only use the script on JPG and always overwrite the images on which it is used.

The entire script output:
Executing EnableOptimizedScriptUndo
Executing Resize
Traceback (most recent call last):
File "<string>", line 65, in Do
AttributeError: 'NoneType' object has no attribute 'Title'

Script 'TestScript' has completed with an error.
I've since replaced ActiveDocument with TargetDocument and everything works as it did.

By the way, on an unrelated note, I've noticed when opening an image and pressing ctrl + s, instead of just a small save prompt, after selecting to overwrite my image, a full blown save as dialog window comes up in X8 whereas it did not happen in previous versions. Do you know of a setting the silence this second dialog from opening?
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: PSPX8 broke X7 and previous script

Post by LeviFiction »

That's interesting, that means there is no ActiveDocment when you run the script. Wonder how that works. xD

The SaveAs thing is the most talked about problem with X8. Corel wanted to make saving better, so when you save a JPG image for the first time during a session it'll open the save as dialog with the compression setting at the bottom for you to use. This is in direct response to people no familiar with PSP's quirks being freaked out that PSP saves by default with a high compression setting. You can avoid this by holding SHIFT when clicking on the Save button on the toolbar. That will run the save command silently. Or do what I did and write a script and bind it to the ctrl + s shortcut. I can control the compression setting and run it silently all at the same time.

We're hoping Corel just gives us back the old method of saving.
https://levifiction.wordpress.com/
corelProps
Posts: 3
Joined: Sat Feb 27, 2016 5:39 am
operating_system: Windows 7 Professional
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSPX8

Re: PSPX8 broke X7 and previous script

Post by corelProps »

How do you bind a specific script to a shortcut? Are there any additional dialogs that pop up?

I think the Save dialog is good as it does allow you to adjust the compression and recommend keeping the feature, but it would be great if there were a simple check box in settings for those more experienced users interested in quick key combos and such.
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: PSPX8 broke X7 and previous script

Post by JoeB »

corelProps wrote:How do you bind a specific script to a shortcut?
Start with this link, then after reading the first paragraph click on the link at the end of the paragraph that reads "Customizing keyboard shortcuts".

http://help.corel.com/paintshop-pro/v18 ... ripts.html

If you have the manual downloaded (or read it online) it's under Automating Tasks>Scripting Basics.
Regards,

JoeB
Using PSP 2019 64bit
Post Reply