Created
May 24, 2012 22:19
-
-
Save hilukasz/2784535 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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