![]() Our second requirement, to be able to use the GUI to browse to our Jpeg source file directory and our Xcf target file directory is handled first in the registration block by using the “ SF- DIRNAME” widgets to label the GUI selection fields and pass the collected results as inputs to the script (above). The items numbered 3 & 4 have image type = “*”. The menu items numbered 1 & 2 have image type = “”. ![]() The image below shows menu items with and without an image loaded. Interactive widgets SF-DIRNAME "JPG Originals (source) Directory" "" SF-DIRNAME "XCF Working (target) Directory" "" ) End script-fu-register ( script-fu-menu-register "script-fu-example-jpg-to-xcf" "/Example-Scm" ) This script will determine the IDs of the Image and Drawable itself rather than having them passed as parameters. Runs from GIMP shell in Linux and Windows." "Stephen Kiel" Author "2013, Stephen Kiel" Copyright "July 2013" Creation Date ** "" Valid Image Type - No Image required** We actually don't want any images open when we run this script, so it must be available from the menu when an image is not loaded. The script is designed to be run WITHOUT ANY IMAGE LOADED. ( script-fu-register "script-fu-example-jpg-to-xcf" Function Name "1 ) Import JPG to XCF (Directory)" Menu Label "This script is an interactive script to convert all of the jpegs in a source directory into GIMP xcf format files in a target directory. The registration block for the script-fu version of the program would look like (the Python registration block follows a similar pattern): Registration Block ¶ What we want instead is an empty string - “” - to specify running without an image open. The “Valid Image Type” is a way to restrict the script from running in an unintended context, “*” is the way to specify “any open image”. You might be tempted to use an image type of “*” to specify running all of the time, but that is not quite what it does. The content of the Valid Image Type is the way that we specify whether we can run the script without an image open.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |