Scripting error question: JascApp.ArrangeInvalid

Moderator: Kathy_9

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: Scripting error question: JascApp.ArrangeInvalid

Post by LeviFiction »

There are several methods to achieve this depending on what you want.

1) If you want to wait a specific amount of time, Import the time module and use the sleep function

Code: Select all

from JascApp import *
from time import sleep

... #script author code goes here

def Do(Environment):
   ... #your normal script data before the wait

   sleep(1) #sleeps for 1 second

   ...#your normal script data after the wait
2) If you just want the code to stop really quick and the amount of time doesn't matter, Insert some code that requires input from the user such as a MsgBox, or Number Prompt.

Code: Select all

result = App.Do(Environment, 'MsgBox', {
    'Buttons': App.Constants.MsgButtons.OK,
    'Icon': App.Constants.MsgIcons.Info,
    'Text': 'We're just stopping here for a moment, hit OK to continue..'
})
3) Finally there's Gary's pause script. This is different from simply waiting for interaction from the user or waiting for a period of time. Gary's pause script lets you run half of the code of your script then save any necessary information to the image description for later retrieval. When you run the script a second time it starts from where it left off. This is used by some script authors to let the person running the script choose settings for their tools, or perform specific edits in between sections of the script. I don't have an example of this. The script template for Gary's Pause Script and how to use it can be fond in the script references topic on this board.
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: Scripting error question: JascApp.ArrangeInvalid

Post by JoeB »

LeviFiction wrote:There are several methods to achieve this depending on what you want.

[SNIPPED]

3) Finally there's Gary's pause script. This is different from simply waiting for interaction from the user or waiting for a period of time. Gary's pause script lets you run half of the code of your script then save any necessary information to the image description for later retrieval. When you run the script a second time it starts from where it left off. This is used by some script authors to let the person running the script choose settings for their tools, or perform specific edits in between sections of the script. I don't have an example of this. The script template for Gary's Pause Script and how to use it can be fond in the script references topic on this board.
For clarification, Gary Barton's Pause script doesn't necessarily only let you run half the script then the other half, but allows you to pause as many times as needed to perform user input, then continue to the next step by running it again, etc., until all steps of the script have been run. :-)

That said, if an example of the Pause script is wanted, I posted a script that does only use two steps and, of course, uses Gary's script to achieve it. The only editing needed by anyone using the script is minor and, in my script (link below) can be see at lines 16 and 157 of the script (def DoStep1(Environment): and def DoStep2(Environment): respectively.) Any number of DoSteps can be created as needed, named in numerical order (that info is also in the header of Gary's script). My script, used as my example, can be found here:

http://forum.corel.com/EN/viewtopic.php?f=104&t=60059

Gary's Pause script is simply pasted after the last step in your recorded or written script, shown starting at line 273 of my script. Gary's Pause script is here (the download link for it is near the bottom of the page that this link goes to, after his explanation of the script):

http://pixelnook.vapho.com/PauseScriptDemo.htm
Regards,

JoeB
Using PSP 2019 64bit
Post Reply