Skip to content

Instantly share code, notes, and snippets.

@hilukasz
Created May 24, 2012 22:19
Show Gist options
  • Save hilukasz/2784535 to your computer and use it in GitHub Desktop.
Save hilukasz/2784535 to your computer and use it in GitHub Desktop.
function MySymbol(input){
this.doc = app.activeDocument;
this.mySymbolIndex = input || 0;
this.mySymbolItem = doc.symbolItems[this.mySymbolIndex];
}
MySymbol.prototype.hasSymbolIndex = function() {
return this.mySymbolIndex <= this.doc.symbolItems.length - 1;
};
MySymbol.prototype.width = function() {
if (!this.hasSymbolIndex()) { return 0; }
return Math.round(this.mySymbolItem.width);
};
MySymbol.prototype.height = function() {
if (!this.hasSymbolIndex()) { return 0; }
return Math.round(this.mySymbolItem.height);
};
var firstSymbol = new MySymbol(1);
firstSymbol.width();
firstSymbol.height();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment