GoDraw Script API Reference

GODRAW V2.0 SCRIPT API REFERENCE

This page is reference page for each of the scripts in the Script API.  GoDraw exposes all of its functionality as FileMaker Scripts. You control GoDraw by calling Scripts, sometimes with a parameter, sometimes, not. Scripts in the API may return a result or nothing or an Error.  Learn more about error handling.

The example files that come with GoDraw use this API. You can use those examples as models for you own integration. For more info on integrations, see the  Basic and Advanced Integration pages.

Editor API


Set List Of Fonts ( listOfFonts )

Purpose: Sets the list of fonts to use in the editor
Parameter: list – a return delimited list of fonts
Returns: nothing

Set List Of Colors ( colors )

Purpose: Sets the list of colors to use in the editor
Parameter: list – a return delimited list of colors, either as hex values ( #FFFFFF ) or color names (“white”)
Returns: nothing

Set Window Title ( windowTitle)

Purpose: Sets the title of the window when the editor opens
Parameter: text – the title to use
Returns: nothing

Set Window Position ( H, W, T, L )

Purpose: Sets position of window when the editor opens, ignored on iOS
Parameter: text – Height, Width, Top, Left
Returns: nothing

Set Hide Window When Done Editing ( True | False)

Purpose: If this is set to true, the GoDraw Editor window will close when a drawing is saved or canceled.
Parameter: boolean – True or False or 0 or 1
Returns: nothing

Set Use Reactor (True | False)  DEPRECATED – Reactor is no longer used

Purpose: If you want to force the use of Reactor set this to true
Parameter: boolean – True or False or 0 or 1
Returns: nothing

Set CallBack File ( filename)

Purpose: set the name of the File that contains the script you want to run when GoDraw closes
Parameter: the name of the File
Returns: nothing

Set CallBack Script ( scriptName)

Purpose: set the name of the script you want to run when GoDraw closes. It should be in the file you set with the “Set CallBack File (filename)” script.
Parameter: the name of the script. Exact spelling and use of white space is required.
Returns: nothing

Set Advanced Options ( options)

Purpose: Adjust some of the defaults for the drawing tools. Read more about it  here.
Returns: nothing
Parameter:
Returns: nothing

Set Advanced Configuration ( Config )

Purpose: Adjust some of the defaults for the drawing tools. Read more about it  here.
Returns: nothing

Set Export App To (trueOrFalse)

Purpose: If true, then GoDraw will run from the temp directory. Mostly used for troubleshooting.  But can help in some scernarios
Returns: nothing

Set PNG File Name ( filename)

Purpose: sets the name that GoDraw will give the resulting PNG file.  Use this to control what the PNG files name will be when you save a Drawing.
Parameter: filename – the name of the PNF file.
Returns: nothing

Set Hidden Tools ( tools)

Purpose: sets  the tools that will be hidden.
Parameter: a string. a list of the tools to hide. Single quoted and separated by a comma
Returns: nothing

Example: this will hide the box-tool and the curve-tool

"'box-tool','curve-tool'"

Here are all the tools you can hide.

  • box-tool
  • circle-tool
  • brush-tool
  • line-tool
  • curve-tool
  • arrow-tool
  • text-tool
  • moveup-tool
  • movedown-tool
  • undo-tool
  • redo-tool
  • delete-tool

 Set Favorite Image 1 ( Image )

Purpose: Set an image into the first Favorite Slot in the editor
Parameter: Image – either a jpeg or png
Returns: nothing

Set Favorite Image 2 ( Image )

Purpose: Set an image into the second Favorite Slot in the editor
Parameter: Image – either a jpeg or png
Returns: nothing

Set Favorite Image 3 ( Image )

Purpose: Set an image into the third Favorite Slot in the editor
Parameter: Image – either a jpeg or png
Returns: nothing

Set Favorite Image 4 ( Image )

Purpose: Set an image into the fourth Favorite Slot in the editor
Parameter: Image – either a jpeg or png
Returns: nothing

Set Favorite Image 5 ( Image )

Purpose: Set an image into the fifth Favorite Slot in the editor
Parameter: Image – either a jpeg or png
Returns: nothing

Set Favorite Image 6 ( Image )

Purpose: Set an image into the sixth Favorite Slot in the editor
Parameter: Image – either a jpeg or png
Returns: nothing

Set Favorite Image X ( Image )

Where X is a number between 7 and 24.  In version 2.0.8 we added the ability to set up to 24 images into the favorites.  So this represents 18 total scripts added to the API. One for favorites 7 through 24.


 Get Current Font List

Purpose: Gets the list of Fonts the editor is using
Parameter: none
Returns: a return-delimited list of Fonts

Get Current Colors List

Purpose: Gets the list of Colors the editor is using
Parameter: none
Returns: a return-delimited list of Fonts

Get Current Window Position List

Purpose: Gets the window position the  editor is using
Parameter: none
Returns: text – Height, Width, Top, Left

Get Current Use Reactor DEPRECATED – no longer used

Purpose: Gets the Use Reactor Setting
Parameter: none
Returns: boolean – True or False or 0 or 1

Get Current CallBack File

Purpose: Gets the current CallBack file name
Parameter: none
Returns: string – the name of the file

Get Current CallBack Script

Purpose: Gets the current CallBack script name
Parameter: none
Returns: string – the name of the script

Get Current Advanced Options

Purpose: Gets the the current undocumented Advanced Options. Only for geist interactive use.
Parameter: none
Returns: string – the options.

Get Current Advanced Configurations

Purpose: Gets the the current undocumented Advanced Configurations. Only for geist interactive use.
Parameter: none
Returns: string – the options.

Get Current PNG File Name

Purpose: Gets the current PNG File Name setting.
Parameter: none
Returns: the name of the PNG file



 Drawing API


Create New Document From Image(  Image  )

Purpose: Creates a GoDraw Document from an image.  The document will be sized based on the image.
Parameter: Image – either a jpeg or png
Returns: a GoDraw Document or Error

Create New Document ( width , height  )

Purpose: Creates a GoDraw Document from dimensions.  There is no background image in this case.
Parameter: text in the form of (width, height)
Returns: a GoDraw Document or Error

Edit Document ( Document )

Purpose: Sends a GoDraw document to the editor.  This is how you open the GoDraw editor.   When the user is done, the  Callback script is called.
Parameter: a valid GoDraw document.
Returns: “Saved” of the user saved the image or “cancelled” if the user cancelled.

Get Last PNG

Purpose: Gets the last saved PNG image from the editor. Commonly used after  getting a “Saved” result from the “Edit Document ( Document )” script.
Parameter: none
Returns: a PNG file

Get Last Document

Purpose: Gets the last saved Document from the editor. Commonly used after  getting a “Saved” result from the “Edit Document ( Document )” script.
Parameter: none
Returns: text – a GoDraw document



Utility API


 Convert Image To DataURL ( Image)

Purpose: Converts an Image to a Data URL
Parameter: image – JPEG or PNG
Returns: text – a data URL or an Error

Still need help? Contact Us Contact Us