Skip to main content
Known Participant
March 15, 2012
Question

is it possible to add method in existing photoshop object model?if yes then pls tell how to add?pls

  • March 15, 2012
  • 1 reply
  • 2150 views

is there is any way of adding method in existing  photoshop object model

This topic has been closed for replies.

1 reply

Paul Riggott
Inspiring
March 15, 2012

Some examples...

var ArtLayer = function () {}
ArtLayer.prototype.showOpacity = function() {
    alert(this.opacity);
};

File.prototype.readByte = function() {//aka unsigned byte
   return this.read(1).charCodeAt(0);
};

String.prototype.trim = function() {
  return this.replace(/^[\s]+|[\s]+$/g, '');
};

Math.__proto__.randomFromTo = function(from, to){
           return Math.floor(Math.random() * (to - from + 1) + from);
};

Known Participant
March 15, 2012

I have to add method through photoshop plugin code in photoshop object model that i can call through script as we call methods already present in photoshop object model.Pls reply

Paul Riggott
Inspiring
March 15, 2012

You are in the wrong forum then, you should be here...

http://forums.adobe.com/community/photoshop/photoshop_sdk