gothica wrote:
I'd like to:
1. User opens image in gimp
2. Then he press hot key and executing script.
In the script i'd like to get filename (for example "picture.jpg) and pass it to parameters
It can't be done. The initial values for the registration parameters are determined when Script-fu is initialized (i.e., when GIMP is first started, or when a Refresh Scripts is performed). These initial values are as declared in the 'script-fu-register' call. Once a particular script is run, subsequent calls of the script will employ the last setting of these values.
Consider this example:
Code:
(script-fu-register "script-fu-anketa"
...
...
SF-FILENAME "Filename" "Original_image_filename")
When you open GIMP, the initial setting for the filename parameter will be "Original_image_filename" and when you run the 'script-fu-anketa' script for the first time, the dialog will fill in the associated text box with that filename. If the user changes that text to something such as "some_other_filename" then the next time the 'script-fu-anketa' script is run, the dialog will present "some_other_filename" in the associated text box.
If you want a dialog to be presented which has its settings initialized to values based on the active image, you will need to write a plug-in (not a script) which handles the creation and management of the dialog manually.
NOTE: SF-VALUE is used for numeric parameters. For filenames one should use either SF-FILENAME or SF-STRING.