latest added image in script-fu is

(vector-ref (cadr (gimp-image-list)) 0)

so  a one-off would be

(map
 (lambda (guide)
   (gimp-image-add-hguide (vector-ref (cadr (gimp-image-list)) 0) guide))
 '(10 230))

I do not know how to get the /active/ image though....

... but here's a script

http://niels.kicks-ass.org/public/gimp/script-fu-add-guides.scm


On Wed, May 27, 2009 at 12:09 PM, David Gowers <00a...@gmail.com> wrote:
> On Wed, May 27, 2009 at 1:04 PM, DJ <delphit...@yahoo.com> wrote:
>> Hi Gimp-user,
>>
>> Didn't see it in the manual, but was wondering if there is a
>> short-cut to adding multiple Guides at once (ie., a comma-separated list)?
>
> It seems difficult to imagine anything faster than the Gimp-python
> console for this:
>
>
> image = gimp.image_list()[0] # get the latest loaded image
>
> for y in (10,20,60,80, 120, 140, 260, 280):
>    pdb.gimp_image_add_vguide (image, y)
>
>
> It should be possible to make a Script-Fu which accepts a list of
> coordinates (space separated) and does something similar to the loop
> above.
> However, I don't know how; I only know how to implement that in Python:
>
> # assuming 'coords' is the string parameter containing space-separated
> coordinates
> realcoords = [int(v) for v in coords.split()]
> for y in realcoords:
>    pdb.gimp_image_add_vguide (image, y)
>
> Adding an option to choose between adding h and v guides should also be easy.
>
>
> David
> _______________________________________________
> Gimp-user mailing list
> Gimp-user@lists.XCF.Berkeley.EDU
> https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
>



-- 
http://niels.kicks-ass.org
_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user

Reply via email to