Need help with using Patterns in name text

Moderator: Kathy_9

craftykid
Posts: 15
Joined: Tue Jan 26, 2021 5:55 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSPProX6 PSPPro2018 PSPPro2019 PSPPr2020

Need help with using Patterns in name text

Post by craftykid »

Hi, New to the board. :) Hope I can explain my problem clearly.
My script is like several others I'm sure. I'm trying to have the users create a sample name on a tag and then use the materials they used to put multiple names on the tag.
I'm writing the script in 32 bit PSP2020 and I have Windows 10.

I can't figure out how to get my script to use a pattern in a list of names when users create the sample text with a pattern. It will do the first name but then won't use the pattern in subsequent names in the list.
It gives an error. I'm sure the problem is that the script doesn't know the name of the pattern to use.
My script works great with colors and gradients but when they use a pattern it gives an error after the first name.

I've tried the GetMaterial command but can't seem to get it right.. :)

I just need to know how to let the script know about any pattern used in my "for loop" to finish the names.
Hope someone can help.
Thank you
LeviFiction
Advisor
Posts: 5985
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, 9, X, XI, X2, X8,X9, 2018, 2019
Location: USA

Re: Need help with using Patterns in name text

Post by LeviFiction »

Cassel would be better at this as she's made several such scripts.

Can you tell me what the error is? And would you feel secure sharing the script or at least the part of the script that fails? If you want to share the whole script, put it into a zip file and upload it either here or to your favorite hosting site. If you only want to share the small snippet of code that fails put the code between [code][/code] tags.
craftykid
Posts: 15
Joined: Tue Jan 26, 2021 5:55 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSPProX6 PSPPro2018 PSPPro2019 PSPPr2020

Re: Need help with using Patterns in name text

Post by craftykid »

Hi Levi
Thank you..

I included a test blank tag for you to use to test the script. Place in a folder by itself. The script will save the tags from the script in the same folder as the blank tag. then open PSP and run the script.
It has a few names in it already for testing purposes .

You can run it with just colors or gradients before you try a pattern, just so you can see how it works. when you try using a pattern you will see the error.

Thank you so much for your help
Last edited by craftykid on Wed Jan 27, 2021 2:46 am, edited 1 time in total.
LeviFiction
Advisor
Posts: 5985
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, 9, X, XI, X2, X8,X9, 2018, 2019
Location: USA

Re: Need help with using Patterns in name text

Post by LeviFiction »

I will need to do more testing but this looks like an "undo" bug inside PSP. I got an error on using a pattern. But it was off. "%u" which is not a useful error. And the script refused to finish. PSP kept saying we can't end the script in the current context. Which was weird. Had to force close it. It did successfully create the first name with the pattern as an image before breaking. The error seems to occur after the 4th "Undo" after saving the first image.
craftykid
Posts: 15
Joined: Tue Jan 26, 2021 5:55 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSPProX6 PSPPro2018 PSPPro2019 PSPPr2020

Re: Need help with using Patterns in name text

Post by craftykid »

Yes, those undo commands are a nightmare! and I wasn't finished with them, still have more to put in for other combinations of commands. The problem is there are so many options in picking the effects and they have different levels of undo's. But I'm not sure I understand in the case of the material being a pattern versus a color or graadient because the number of undo's should be the same even if the material is a pattern. If the # of undo's work for the colors and gradients, they should work for the pattern because the # of commands to undo is the same. This is why I'm confused. That's why I thought it was because it didn't save the name of the pattern to use on the rest of the names.

and yes that is the same error I'm getting.
LeviFiction
Advisor
Posts: 5985
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, 9, X, XI, X2, X8,X9, 2018, 2019
Location: USA

Re: Need help with using Patterns in name text

Post by LeviFiction »

My suggestion, avoid the Undos.

Duplicate the original layer, then hide it. Change the characters of the text object in the duplicate layer, and do everything you normally do. Then, instead of Undoing the commands, delete the layer. At the start of the loop duplicate the original layer again, and so on. Always moving forward, never undoing. You won't have to keep track of them at all.
craftykid
Posts: 15
Joined: Tue Jan 26, 2021 5:55 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSPProX6 PSPPro2018 PSPPro2019 PSPPr2020

Re: Need help with using Patterns in name text

Post by craftykid »

Hmmmmmmmmm that's interesting. I'll have to try that. That would be wonderful to get rid of all those undos.. they were driving me nuts.. lol. You think that will solve the pattern problem also?

I'll go work on that. I'm going to delete the link to my script in the above post now.

Thanks, hopefully that will solve it. This is my first ever PSP script so I'm really in a learning mode. :)
LeviFiction
Advisor
Posts: 5985
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, 9, X, XI, X2, X8,X9, 2018, 2019
Location: USA

Re: Need help with using Patterns in name text

Post by LeviFiction »

Yes it will, I made some edits to the script myself and it ran flawlessly with patterns as long as I removed any undo commands.
craftykid
Posts: 15
Joined: Tue Jan 26, 2021 5:55 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSPProX6 PSPPro2018 PSPPro2019 PSPPr2020

Re: Need help with using Patterns in name text

Post by craftykid »

Great, I'm working on the duplicate layer, delete layer suggestion that you gave.. Hopefully i can get that working too. That was the last thing that was holding up finishing my script, so if I get that done I'll be finished with it.. YAYYYYYYYYYYY.
You've been a great help!
craftykid
Posts: 15
Joined: Tue Jan 26, 2021 5:55 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSPProX6 PSPPro2018 PSPPro2019 PSPPr2020

Re: Need help with using Patterns in name text

Post by craftykid »

It works!!!! Yayyyyyyyyyyyy :)
craftykid
Posts: 15
Joined: Tue Jan 26, 2021 5:55 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSPProX6 PSPPro2018 PSPPro2019 PSPPr2020

Re: Need help with using Patterns in name text

Post by craftykid »

I'm back. I'm tesing my script in other versions. it worked perfectly in X6, but in 2018 and 2019 I get this message when I run it. When I say ok, the script runs perfectly except I keep getting this message every time I click run after the pauses in my script. Then I just click ok and it continues with my script. very annoying.
It is very interesting though that it DIDN'T give me this message when I ran it in X6. It ran just like it does in 2020. X6 is an older version than 2018 and 2019. sighhh How do I stop getting the message in 2018 and 2019?

Image
LeviFiction
Advisor
Posts: 5985
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, 9, X, XI, X2, X8,X9, 2018, 2019
Location: USA

Re: Need help with using Patterns in name text

Post by LeviFiction »

Make sure you've recorded the version properly. In the ScriptProperties function make sure "Host Version" is set to the lowest version of PSP you want to be able to support. Same with the "Version" parameter of each of the commands in the script or it'll complain. I don't know why X6 didn't complain but yeah that should be all you need.

Try setting it from 22 to 16 that will tell PSP
craftykid
Posts: 15
Joined: Tue Jan 26, 2021 5:55 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSPProX6 PSPPro2018 PSPPro2019 PSPPr2020

Re: Need help with using Patterns in name text

Post by craftykid »

Thank you.. I'll edit that version info in. Actually I like it to go back further to at least jasc Version 9 but I don't have those versions to test. The oldest I have is X3 so I think I'll set it at X3 for now.
craftykid
Posts: 15
Joined: Tue Jan 26, 2021 5:55 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSPProX6 PSPPro2018 PSPPro2019 PSPPr2020

Re: Need help with using Patterns in name text

Post by craftykid »

ok, some weird stuff going on.. lol I changed the version info to 13 which is X3.. X6 and 2020 run just fine. 2018 and 2019 - the error message above is gone BUT when I run the script, 2018 and 2019 will no longer open the folder to pick a tag. Both of them now open immediately the tag that is in the file list in the File Open section of step 1. It's like they are ignoring the File Open command. I'm going to change the version to 16 to see what happens but if X6 works with 13, what is causing 2018 and 2019 to not work right. It's only the File Open. If I continue with the script the rest works fine.
craftykid
Posts: 15
Joined: Tue Jan 26, 2021 5:55 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PSPProX6 PSPPro2018 PSPPro2019 PSPPr2020

Re: Need help with using Patterns in name text

Post by craftykid »

i changed the version to 16 and same thing in 2018 and 2019 so I put the original version back (version 22). error message is back which I expected but now 2018 and 2019 are still doing the same thing. Ignoring File Open command where before they worked fine except for the error message. It's like something in 2018 and 2019 has an option or something that has been reset and overrides the script. I'm at a loss now. X6 and 2020 work with all of the ones I changed.. versions 13, 16 and 22..
Post Reply