I am using Gimp 2.8.2 on Windows 7. I have some
python scripts that I wrote when I was using Gimp 2.6 (on same Window 7 laptop). They worked with Gimp 2.6, and when I upgraded to Gimp 2.8, the scripts were copied (I assume during the installation process) to the appropriate plug-in directory for GIMP 2.8, as copies of the scripts are located in both the GIMP 2.8 plug-in directory and the Gimp 2.6 plug-in directory. When I start Gimp 2.8, the plug-ins show in the appropriate menu. Further, I recently (since upgrading to Gimp 2.8) downloaded a script written by someone else and copied it to the appropriate Gimp 2.8 plug-in directory and it shows in the appropriate menu.
My question/issue is this, I created a new script and saved it to the appropriate Gimp 2.8 plug-in directory. When I start Gimp, I see a reference to the new script in the Gimp start-up flash screen 9along with all the other scripts). However, it is not showing in the menu?
The following is a copy of my code (note, the script does not do anything fancy, just trying to learn how this all works):
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from gimpfu import *
from gimpenums import *
# create an output function that redirects to gimp's Error Console
def gprint( text ):
pdb.gimp_message(text)
return
# our script
def my_print_script():
g = gimp.pdb
the_image = gimp.image_list()
the_layers = the_image[0].layers
for l in the_layers:
if g.gimp_item_get_visible(l) == 0:
gprint ("Layer is already invisible!")
else:
g.gimp_item_set_visible(l, 0)
g.gimp_item_set_visible(the_layers[0], 1)
return
# This is the plugin registration function
register(
"Print 4x6",
"A procedure to crop an image to a 4x6 aspect and save a print version.",
"A simple Python Script that can crop an image to a 4x6 aspect and save a print version.",
"rph",
"rph",
"November 8, 2012",
"<Image>/MyScripts/Print 4x6",
"*",
[],
[],
my_print_script)
main()
Is there an issue with Gimp 2.8 that I am missing, or am I making some silly coding error that I am missing?
Any help would be appreciated. Thanks.