Guest User

Untitled

a guest
Jan 28th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Include the JSON helper
  2. #include "JSON.jsx"
  3. // Include the descriptor-info module
  4. #include "descriptor-info.jsx"
  5.  
  6. // ActionDescriptor example  
  7. var ref = new ActionReference();  
  8. //ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );  
  9. ref.putEnumerated( charIDToTypeID("Path"), charIDToTypeID("Path"), stringIDToTypeID("vectorMask") );  
  10. var desc = executeActionGet(ref);  
  11.  
  12. // Retrieve its properties by running the getProperties function, passing the ActionDescriptor as a param
  13. // Optional @param {Object} descFlags
  14. // Optional @flag {Boolean} reference - return reference descriptors. Could slighly affect speed.
  15. // Optional @flag {Boolean} extended - returns extended information about the descriptor.
  16. var descFlags = {
  17.     reference : true,
  18.     extended : false
  19. };
  20.  
  21. var descObject = descriptorInfo.getProperties( desc ); // If using descFlags > descriptorInfo.getProperties( desc, descFlags );
  22.  
  23. // Running in ExtendScript
  24. $.writeln(JSON.stringify(descObject, null, 4));
  25.  
  26. // Running in Brackets with the Brackets-to-Photoshop extension
  27. // https://github.com/JavierAroche/brackets-to-photoshop
  28. // Brackets-to-Photoshop extension includes the JSON helper by default
  29. $.writeln(descObject);
Add Comment
Please, Sign In to add comment