Skip to content

Collection of helpful functions for scripting in Illustrator

License

Notifications You must be signed in to change notification settings

youandhubris/IllustratorScripting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IllustratorScripting

Collection of helpful functions for scripting in Illustrator.


Documentation

Table of Contents

BridgeTalk

Simple helpers to use Adobe's BridgeTalk class.

Setup

Setups BridgeTalk Message and define a global function 'BridgeTalkOnResult()'.

Message

Send Bridge Talk Message.

Parameters

  • bTMessage string Message.
  • target string Target application.

Color

Color class.

GetRGBColorFromObject

Converts generic object (with red, green, blue properties) to Adobe's RGBColor object.

Parameters

Returns RGBColor RGBColor

GetCMYKColorFromObject

Converts generic object (with cyan, magenta, yellow, key, properties) to Adobe's CMYKColor object.

Parameters

Returns CMYKColor CMYKColor

GetSwatchArray

Get all colors from a specific SwatchGroup / Palette

Parameters

Returns Array<Color> Array of Color

Data

Data class. TODO.

SetFolder

Prompts message for folder selection.

Parameters

Returns string

LoadData

Reads file and returns JSON object.

Parameters

Returns JSON

FileToJSON

File to JSON object.

Parameters

  • fileObject File

Returns JSON

SaveFile

Saves, and overwrites, text file.

Parameters

Documents

Documents class.

GetActiveDocument

Get Active Document

Returns Document

Export

Export class. TODO.

SaveAsAI

Saves active document as Ai.

Parameters

GUI

GUI class.

ClearWindow

Delete previous window session.

Parameters

HUBRIS

The main class/object, for a 'namespace-like' structure in Javascript.

Layers

Layers class.

GetLayersByName

Searches layers by name.

Parameters

  • layersArray Array<Layer> Array of Layer.
  • namesArray Array<string> Array of strings.
  • maxDepthLevel number How many sub-layers.
  • returnOnlyFirst boolean One or all occurances.

Returns Array<Layer> Array of Layer objects.

RemoveLayersByName

Deletes layers by name.

Parameters

  • layersArray Array<Layer> Array of Layer.
  • namesArray Array<string> Array of strings.
  • maxDepthLevel number How many sub-layers.
  • removeOnlyFirst boolean One or all occurances.

Logger

Logger class, to use as in GUI console.

ToConsole

Appends message to 'log' variable.

Parameters

  • message string
  • level string Notice, Warning or Error. (Defaul: Notice).

LogClear

Clears 'log' variable.

toString

Object to 'log' string.

Returns string

Math

Data class.

GetNthOccurance

Returns the index of the specified occurance.

Parameters

Returns number If -1, occurance not found.

MMToPoint

Converts millimeter to point.

Parameters

Returns number

PointToMM

Converts point to millimeter.

Parameters

Returns number

MapValue

Maps value given in/out limits.

Parameters

Returns number

Settings

Data class.

GetUserSettings

Returns user settings from ~/Library/Application Support/HUBRIS.

Parameters

Returns string JSON object.

SaveUserSettings

Saves user settings to ~/Library/Application Support/HUBRIS.

Parameters


Documentation created with documentationjs

About

Collection of helpful functions for scripting in Illustrator

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published