RSS/Atom feed Twitter
Site is read-only, email is disabled

Script-fu: What does gimp-image-list return?

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

Script-fu: What does gimp-image-list return? Volker Lenhardt 22 Aug 21:33
  Script-fu: What does gimp-image-list return? Volker Lenhardt 22 Aug 23:29
Volker Lenhardt
2002-08-22 21:33:20 UTC (over 21 years ago)

Script-fu: What does gimp-image-list return?

Hello again,

I want to reference all open images by ID. So I stumbled across "gimp-image-list" and read in the PDB that it returns the number of open images as number and their IDs as array.

I hopefully opened three images and typed (gimp-image-list) in the script-fu console. The output was: (3 #(0 1 2)#3"000000"). What does it mean?

I can see that there are 3 images with the IDs 0, 1, 2. But what's the rest? Obviously it's the amount again with two zeros for each open image. But what for? And most important: how do I reference the IDs from within a script? I tried some list, some vector, some array functions, with no avail, nearly all of them returned errors. The only information I could get was with (length (cadr (gimp-image-list))). It returned 3.

Where can I find an annotated list of valid script-fu functions? The list I get with apropos in the console leaves me helpless. Even (array? (cdr (gimp-image-list))) or
(array? (cadr (gimp-image-list)))
resulted in ERROR: unbound variable (errobj array?).

Everything will turn good. Volker

Volker Lenhardt
2002-08-22 23:29:39 UTC (over 21 years ago)

Script-fu: What does gimp-image-list return?

I found it out for myself. There you try for hours and are getting nearly mad and a few minutes after the cry for help it's all obvious: aref!

But the console's output to gimp-image-list stays to be somewhat enigmatic to me.

Greetings from Volker

Am Donnerstag, 22. August 2002 21:33 schrieb Volker Lenhardt:

Hello again,

I want to reference all open images by ID. So I stumbled across "gimp-image-list" and read in the PDB that it returns the number of open images as number and their IDs as array.

I hopefully opened three images and typed (gimp-image-list) in the script-fu console. The output was: (3 #(0 1 2)#3"000000"). What does it mean?

I can see that there are 3 images with the IDs 0, 1, 2. But what's the rest? Obviously it's the amount again with two zeros for each open image. But what for? And most important: how do I reference the IDs from within a script? I tried some list, some vector, some array functions, with no avail, nearly all of them returned errors. The only information I could get was with (length (cadr (gimp-image-list))). It returned 3.

Where can I find an annotated list of valid script-fu functions? The list I get with apropos in the console leaves me helpless. Even (array? (cdr (gimp-image-list))) or
(array? (cadr (gimp-image-list)))
resulted in ERROR: unbound variable (errobj array?).

Everything will turn good. Volker