Created
September 13, 2013 05:11
-
-
Save toshinoritakata/6546966 to your computer and use it in GitHub Desktop.
Photoshopのデータセットの読み込みと適用
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
cTID = function(s) { return app.charIDToTypeID(s); }; | |
sTID = function(s) { return app.stringIDToTypeID(s); }; | |
fileImportDataSets = function(file) { | |
var desc = new ActionDescriptor(); | |
var ref = new ActionReference(); | |
ref.putClass( sTID( "dataSetClass" ) ); | |
desc.putReference( cTID( "null" ), ref ); | |
desc.putPath( cTID( "Usng" ), new File( file ) ); | |
desc.putEnumerated( cTID( "Encd" ), sTID( "dataSetEncoding" ), sTID( "dataSetEncodingAuto" ) ); | |
desc.putBoolean( sTID( "eraseAll" ), true ); | |
desc.putBoolean( sTID( "useFirstColumn" ), true ); | |
executeAction( sTID( "importDataSets" ), desc, DialogModes.NO ); | |
} | |
applyDataSet = function(setName) { | |
var desc = new ActionDescriptor(); | |
var setRef = new ActionReference(); | |
setRef.putName( sTID( "dataSetClass" ), setName ); | |
desc.putReference( cTID( "null" ), setRef ); | |
executeAction( cTID( "Aply" ), desc, DialogModes.NO ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment