Running successive scripts

Moderator: Kathy_9

Post Reply
terrypin
Posts: 492
Joined: Tue Jun 29, 2010 9:51 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Asus Z170 Pro 4
processor: Intel Core i7 6700K 4.0GHz
ram: 32 GB
Video Card: None - uses built-in graphics
sound_card: HD onboard sound card
Hard_Drive_Capacity: 4.256 TB
Monitor/Display Make & Model: iLyama Prolite E2403WS 24" 1920x1200
Corel programs: Paint Shop Pro 8; Paint Shop Pro 2018
Location: East Grinstead UK

Running successive scripts

Post by terrypin »

Suppose you have several working scripts, say A, B and C, which work fine when you run them individually on an image, one after the other. Is there some consistently reliable method to combine them in a new script X please? My attempts to do it by pasting the text into a new file have failed, despite all sorts of (admittedly uninformed) editing. Usually the result has been either nothing at all, ran but gave an obscure error, or ran but performed only the later part of the script.

--
Terry, East Grinstead, UK
--
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
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: Running successive scripts

Post by JoeB »

Do you want all of the commands in all three of the scripts to run from start to finish, or do you want to have the first script run, then pause to do something else to the image, then run the second script, pause, then run the third script? In any event, you will likely have to post the three scripts and your combined script to let people determine what the problem might be. You might be copying some code from scripts B and C that is causing the issues.

EDIT: Ooops, I see that you had a previous thread going and have posted a couple of scripts there, so maybe the responders in that thread will solve your problem.
Regards,

JoeB
Using PSP 2019 64bit
terrypin
Posts: 492
Joined: Tue Jun 29, 2010 9:51 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Asus Z170 Pro 4
processor: Intel Core i7 6700K 4.0GHz
ram: 32 GB
Video Card: None - uses built-in graphics
sound_card: HD onboard sound card
Hard_Drive_Capacity: 4.256 TB
Monitor/Display Make & Model: iLyama Prolite E2403WS 24" 1920x1200
Corel programs: Paint Shop Pro 8; Paint Shop Pro 2018
Location: East Grinstead UK

Re: Running successive scripts

Post by terrypin »

Thanks. Yes, I want to run all three successively, with no manual intervention.

My post did arise from that other long thread about a specific problem. But I'm generalising here. IOW, is there a tried and tested way to do this in a text editor? I'm guessing you can paste them in, bu then have to remove some parts and/or other editing?

--
Terry, East Grinstead, UK
--
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
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: Running successive scripts

Post by JoeB »

terrypin wrote:Thanks. Yes, I want to run all three successively, with no manual intervention.

My post did arise from that other long thread about a specific problem. But I'm generalising here. IOW, is there a tried and tested way to do this in a text editor? I'm guessing you can paste them in, bu then have to remove some parts and/or other editing?

--
Terry, East Grinstead, UK
Not really, except that you don't have to copy the headers with stuff like PSPApp, etc at the top. And as mentioned by others in the other thread you have to make sure you copy from the left margin to the right at the bottom to ensure that you aren't missing the spacing and are keeping all the syntax intact. And depending on what script you're copying to add to another script the last command of the upper script and the first command of the added script have to be compatible. In other words, if the last command is such that it makes it impossible for the first command of the next script to be able to run then the script will stop with an error, but I can't think of an example where that would happen at the moment.
Regards,

JoeB
Using PSP 2019 64bit
terrypin
Posts: 492
Joined: Tue Jun 29, 2010 9:51 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Asus Z170 Pro 4
processor: Intel Core i7 6700K 4.0GHz
ram: 32 GB
Video Card: None - uses built-in graphics
sound_card: HD onboard sound card
Hard_Drive_Capacity: 4.256 TB
Monitor/Display Make & Model: iLyama Prolite E2403WS 24" 1920x1200
Corel programs: Paint Shop Pro 8; Paint Shop Pro 2018
Location: East Grinstead UK

Re: Running successive scripts

Post by terrypin »

Thanks. What I'm doing is simply this:
1. Open A and B separately in my text editor (or Notepad)
2. Go to the line in A below the last and use Enter to add a blank line
3. At the start of the line below, paste in script B.
4. Remove the duplicated lines at the start of the second script's contribution

Code: Select all

from JascApp import *

def ScriptProperties():
    return {
        'Author': 'Terry Pinnell',
        'Copyright': '',
        'Description': '',
        'Host': 'Paint Shop Pro',
        'Host Version': '8.10'
        }
5. Save with a new name, say A+B.pspscript.

Is that all OK?

--
Terry, East Grinstead, UK
--
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
Post Reply