GIMP Chat http://gimpchat.com/ |
|
Script writer newbie http://gimpchat.com/viewtopic.php?f=9&t=18003 |
Page 1 of 1 |
Author: | Pocholo [ Sat Feb 08, 2020 2:39 pm ] |
Post subject: | Script writer newbie |
Hi everyone! I'm trying to learn how to write scripts and I'm going through the basics. I'm trying to create a simple "Slider" dialog that will create a New image. But when I'm trying to run it, it's giving me an error. Can any experience coder here explain what am I doing wrong? "Error while executing script-fu-new-layer-white: Error: eval: unbound variable: image" This is what the script looks like: Code: Select all (define (script-fu-new-layer-white) |
Author: | ofnuts [ Sat Feb 08, 2020 7:16 pm ] |
Post subject: | Re: Script writer newbie |
Pocholo wrote: I'm trying to learn how to write scripts So you should really use Python instead. Much easier to learn. This said, looking at your code, gimp-image-new and gimp-layer-new both return the id of the created image layer, so you have to keep these somewhere to be able to reuse them in the following function calls. |
Author: | MareroQ [ Sat Feb 08, 2020 11:49 pm ] |
Post subject: | Re: Script writer newbie |
Hi Pocholo. Did Ofnuts' comments help? If not - see for example: Code: Select all (define (script-fu-new-layer-white size) And three more comments: 1. If you enter the selection parameter (SF-ADJUSTMENT) must be defined. 2. SF-ADJUSTMENT "Layer Size (px)" '(400 1200 1 10 0 SF-SLIDER) requires 7 arguments (not 6) 3. Location on the menu is probably: "<Image>/File/Create/New layer..." (not Files) Python basics are probably easier to learn (and only this has a future...) Good luck in Your studies ![]() |
Author: | Pocholo [ Sun Feb 09, 2020 1:36 am ] |
Post subject: | Re: Script writer newbie |
@ ofnuts: Thank you so much for the advise! I will give it a try at python scripting. @MareroQ: Thank you for the fixing! You guys are awesome! ![]() ![]() |
Page 1 of 1 | All times are UTC - 5 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |