Created
March 27, 2016 16:52
-
-
Save DieterHolvoet/ac8130bdf0f0c6c6602b to your computer and use it in GitHub Desktop.
A series of Document prototype functions for Adobe Extendscript
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
/* Get file extension of document */ | |
Document.prototype.getFileExtension = function() { | |
var str = this.fullName.fsName; | |
return str.substring(str.lastIndexOf(".") + 1); | |
}; |
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
/* Get file name of document */ | |
Document.prototype.getFileName = function() { | |
var str = this.fullName.fsName; | |
return str.substring(str.lastIndexOf("\\") + 1, str.lastIndexOf(".")); | |
}; |
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
/* Get full path of document */ | |
Document.prototype.getFullPath = function() { | |
return this.fullName.fsName; | |
}; |
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
/* Get full path of the folder of the document */ | |
Document.prototype.getFolderPath = function() { | |
var str = this.fullName.fsName; | |
return str.substring(0, str.lastIndexOf("\\")); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment