home *** CD-ROM | disk | FTP | other *** search
/ PC Extra 07 & 08 / pca1507.iso / Software / psp8 / Data1.cab / ToggleToSelection.PspScript < prev    next >
Encoding:
Text File  |  2003-04-22  |  1.1 KB  |  24 lines

  1. from JascApp import *
  2.  
  3. def ScriptProperties():
  4.     return {
  5.         'Author': 'Joe Fromm',
  6.         'Copyright': 'Copyright (C) 2002-2003, Jasc Software Inc., All Rights Reserved. Permission to create derivate works of this script is granted provided this copyright notice is included',
  7.         'Description': 'Emulate the Corel behavior of toggling from the current tool to the selection tool.',
  8.         'Host': 'Paint Shop Pro',
  9.         'Host Version': '8.00'
  10.         }
  11.  
  12. def Do(Environment):
  13.     # get the name of the current tool.   Do this by calling SetTool but
  14.     # specifying an empty string for the new tool name.  This returns the
  15.     # current tool name without changing tools
  16.     CurrentTool = App.Do( Environment, 'SelectTool', { 'Tool': '' } )
  17.   
  18.     if CurrentTool == 'FreehandSelection':
  19.         # we are on the freehand tool, select the previous tool
  20.         App.Do( Environment, 'SelectPreviousTool' )
  21.     else:
  22.         # not on the freehand tool, go to it
  23.         App.Do( Environment, 'SelectTool', { 'Tool':'FreehandSelection' } )
  24.