Re: [Gimp-user] Automated sequence of actions with keyboard short cuts?

2007-02-26 Thread Joao S. O. Bueno Calligaris
On Monday 26 February 2007 00:35, Dave M G wrote:
> GIMP Users,
>
> Because of the nature of my work, I have to repeat the same set of
> commands over and over again. These commands are:
>
> 1. Create a selection from a path (I don't know if there's a
> keyboard shortcut for this)
> 2. Select->Sharpen to remove any anti-aliasing (again, I don't know
> if there's a keyboard shortcut for this)
> 3. Fill with foreground colour ([ctrl+,])
> 4. Deselect the selected area ([ctrl+shift+a], or [ctrl+d] under my
> current settings)
> 5. Delete the path (which I currently do by selecting a different
> tool and then selecting the path tool again - I'm sure there's a
> better way)
>


Hi Dave

I am in a bit of a hurry now, but tin the GIMP there are 2 ways of 
assigining shortcuts to any desired action
.

Please, click in ->File->Prefrences and interface and read 
the instructions on "Dynamic Keyboard shortcuts"  or just go from 
there to a shortcut assignment interface.

Also, you should consider makig a script - either in script-fu or 
gium-fu to repeat this sequence - it is actually easy, if you see 
some ofthe .py and .scm files taht come with the GIMP, and check the 
Procedure Database in ->Xtns->PDB Browser


Regards,
js
-><-

> I do this over and over again as I colour an image, so if I could
> automate this process it would save me an immense amount of time,
> and probably prevent a lot of potential for human error.
>
> When I did a Google search for possible solutions to this, I used
> the term "batch" processing. But in GIMP world this term is
> apparently used to refer to running multiple filters or other
> actions on a file from the command line by creating a script. That
> seems a little different from what I'm after. But I'm afraid my
> imagination for alternate terms is lacking, and I couldn't think of
> any terms that came up with what I was after.
>
> Is there a way I can save a custom sequence of processes, and then,
> dare I hope, bind that sequence to a keyboard shortcut?
>
> Thank you for any advice or information.
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Automated sequence of actions with keyboard short cuts?

2007-02-26 Thread saulgoode
Quoting Dave M G <[EMAIL PROTECTED]>:

> GIMP Users,
>
> Because of the nature of my work, I have to repeat the same set of
> commands over and over again. (...SNIP...)
> Is there a way I can save a custom sequence of processes, and then, dare
> I hope, bind that sequence to a keyboard shortcut?

I had a few minutes free so I whipped up a script-fu which I think  
will do the task you described. I have even commented it so that you  
might see how it works (and perhaps modify it). I haven't tested the  
script on GIMP 2.2 (I am using a development version) so let me know  
if it doesn't work.

The command is not assigned to a keystroke but you can do so from the  
"File->Preferences->Interface->Configure keyboard shortcuts->Plugins"  
where you should click on the "Fill Path With FG" command and then hit  
the key you wish assigned.

NOTE: If you perform an UNDO after executing the command, you will no  
longer see the path because you won't be in "edit mode"; the path is  
still there but you will have to manually switch back to edit mode.

The script is available at:

http://www.flashingtwelve.brickfilms.com/GIMP/Scripts/Temp/fill-path.scm
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Automated sequence of actions with keyboard short cuts?

2007-02-25 Thread Dave M G
Claus,

Thank you for responding.
> you could write a Script-Fu to do that.

Writing scripts looks kind of hard, as I'm not a programmer or coder by 
nature. But I'm game to try. So I read some of the pages you suggested, 
and also looked up a little info on the web.

I've worked out some of the commands I think I need from the "Procedure 
Browser", and then I looked at some other script files already installed 
on my machine to try and get some sense of the syntax. My first draft of 
the script is at the end of this message.

I'm confused on two points.

One is that the names of the procedures in the "Procedure Browser" don't 
seem to follow the same format as they do in the scripts in my scripts 
directory. In the scripts directory, they use dashes, "-" in their 
names, like "gimp-path-to-selection". But in the "Procedure Browser", 
they all use underscores, "_", like "gimp_path_to_selection". What 
should I be using?

The other is that the parameters often list as their first option to 
specify the image. For example, "gimp_path_to_selection", has this at 
the top of its list of parameters:
imageIMAGEthe image

Since I don't intend to be using this script at the command line, and 
will be using it on an image that I will have open in the GIMP GUI, do I 
need to specify this? Or do I need to use some kind of variable that 
specifies the currently active image?

Here is my first draft. If someone could help me make the syntax 
correct, then I think I could use it as a model for continuing to create 
my own scripts.

- colour_flat.scm

; Create anti-aliased colour flats from a path.

(define (colour_flat))

; Convert the path to a selection.
(gimp_path_to_selection)

; Sharpen the selection to ensure it is not anti-aliased.
(gimp_selection_sharpen)

; Fill the selected area with the current foreground colour.
(gimp_edit_fill (GIMP_FOREGROUND_FILL (0)))

; Deselect the currently selected area.
(gimp_selection_none)

; Remove the path.
(gimp_path_delete)

-file ends-

Thank you for any assistance or advice.

-- 
Dave M G
Ubuntu 6.10 Edgy Eft
Kernel 2.6.17.7
Pentium D Dual Core Processor
PHP 5, MySQL 5, Apache 2
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user