Is it possible to modify the prototype of the object of a DOM?

I can change the prototype of built-in Javascript types, for example:

Array.prototype.indexOf = function(elt/*, from*/) {
    var len = this.length >>> 0;

    var from = Number(arguments[1]) || 0;
    from = (from < 0)
        ? Math.ceil(from)
        : Math.floor(from);
    if (from < 0)
        from += len;

    for (; from < len; from++) {
        if (from in this &&
            this[from] === elt)
        return from;
    }
    return - 1;
};

Do the same to the Photoshop DOM objects, such as Document or sets of layers? When I try to access to Document.prototype or activeDocument.layers.prototype I get an error of Document is not defined ...

What I understand there many classes in the Photoshop DOM, which are not loaded into memory until the object of this class is referenced. Which means you need to do something like that.

App.documents[0];// load the Document class by referring to a document object.

Document.prototype.foo = function() {return 'bar'};

app.activeDocument.foo ();

Tags: Photoshop

Similar Questions

  • Is possible to name the objects in the HTML code of muse?

    I'm a graphic designer to work whit a programmer to make Web sites. We want to work togher me taking care of him and graphic part work whit code PHP CSS and all other coding things in really offen my programmer, Web sites have to work whit code the HTML of my muse sites and they have a lot of problem to find the names of the objects in the code because muse give them nemes as CFG67 and for him it's really hard to find an object in the Code since I can't give them a few names.

    Therefore, it is possible to give a name to every graphical object, I did Muse?

    Hello

    Please see the post on the forum for the same below.

    Adding Custom id, & css to the elements class

    in the Muse, you cannot change the classes, IDs that are generated by Muse, however you can click on the link below and vote in favour of the idea of introducing this feature of Muse.

    Add id and custom classes

    Concerning

    Vivek

  • Is it possible to get the object of doc JS of a PDF document that is opened in a web browser?

    As I mentioned in a previous post on the Scripting Forum (http://forums.adobe.com/thread/427791), methods that previously worked in Acrobat 8 to get the object of doc JS of a PDF document that is opened in a web browser - for example App.activeDocs . using the JS object and AcroApp.GetAVDoc (index). GetPDDoc using OLE automation - no longer works in Acrobat 9.  Therefore, in Acrobat 9, it is impossible to access a PDF file that is opened in a browser or in its annotations (except, of course, the PDF is downloaded to the computer and open through the NTFS, which kind of defeated the purpose).


    What is someone is aware can explain how to get the object of doc JS of a PDF document that is opened in a web browser?

    If the plugin exposes a DDE interface - of course.  But this assumes that he is there--it is not automatic.  You will need to write your own plugin or get an update if necessary.

    And thanks for the info: I'm passing along!

  • Is it possible to modify the APN/Wireless device?

    Hello world

    is it possible (given the right permissions) for a request to change the APN settings or wireless unit?

    If not, is there another way to a device installation settings network via OTA?

    I was also wondering what is he really the ApplicationPermissions.PERMISSION_DEVICE_SETTINGS?

    Thanks in advance

    You can write a program that acted as aid ' and told me what to do users.  However you can't do it for them sorry.

  • Is it possible to modify the XML mapped schema that is generated by the action of submit before submitting?

    I have a form created in LiveCycle ES2. I have a few fields mapped to a schema which causes LC to generate XML data that follow the format for importing one of the internal databases of my company.

    There is a problem: the system import feature seeks a DOCTYPE DTD declaration between the XML declaration and root element. I tried including the declaration in the schema, but LC does not include it in the values mapped or export. I spoke with the seller on the declaration of the DTD as part of the import function and they gave a firm "no."

    Is there a way to insert a single line of markup in the XML that LC generates in the action to submit before the XML code is attached to the email?

    Hello

    You can use XSLT to transform the outbound data.

    I have never done this for the addition of a DTD, but Google finds solutions for the term "xslt adds dtd" it should be possible.

    Adding a DOCTYPE statement on the output XSL - Scriptorium Publishing

    Set the DOCTYPE in XSL, Bernie Zimmermann

  • Is it possible to change the text using fonts Std of ITC Officina Sans Acrobat Pro?

    Is it possible to modify the test using std Officina Sans ITC fonts in Acrobat? I just downloaded acrobat and when I tried to change a few tests in the PDF file, a message popped up saying that the Std of ITC Officina without is not available or cannot be used in editing. Any ideas, downloads or similar fonts that I can use to solve this problem.

    Really need this font if not the whole PDF will look bad.

    Mise put on fast day, turns out I can't use Armada is a police. It seems that Acrobat Pro 11 has not all fonts I need.

    Discover the answer to Dov Isaacs in this forum announcement. Re: fully embedding the fonts in PDF format

    His comment:... Acrobat never uses the font incorporated to text editing - you must have the fonts installed on the system to make these changes. (emphasis added)

  • Is it possible to use the F5 key without pressing Fn on Thinkpad E530

    Hello

    I need to use the F5 button a lot, but every time I have to press the aswell key Fn. would it possible to modify the key F5 parameters and how?

    There are 2 ways to do this:

    1. in Start menu, type "Keyboard" and choose the keyboard option that appears under 'Control Panel'.  There is a "ThinkPad F1 - F12 keys" tab, and you can change the choice of "Legacy" to use the F1 - F12 keys as standard function keys you want.

    2. restart the system and press ENTER to the ThinkPad logo screen.  Then press F1 to access the BIOS Setup.  In the "Config" menu, choose "keyboard and mouse".  Change the option "Change to the F1 - F12 keys" to "Legacy".  Press F10 to save and exit.

    .

  • modify the check constraint

    Hello friends...
    I want to edit the check constraint... It is possible to modify the check constraint?


    ALTER TABLE table_name
    change (CONSTRAINT constr_name CHECK (yes_no_col_name IN ('n', 'Y')))

    It gives me

    name of the constraint that is already in use


    Thank you...

    You can't modify a check constraint. You can only change its State.

    Check the document.

    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/statements_3001.htm#i2103997

  • Reference the object expected found execution

    I have a .NET DLL that has a method that takes a parameter of reference an object of type NationalInstruments.TestStand.Interop.API.Execution. In TestStand 4.2.1 it worked well if I spent it RunState.Execution.

    Now in 2010 TestStand I get an error in TestStand that the method expects an object reference, but found a writ of execution. A performance, that's what I want is what describes the method. Then, why this doesn't work?

    Anyone have any ideas?

    Thank you.

    Skeptical salvation,

    It is a known backwards compatibility problem introduced in 2010 TestStand and will be fixed in a later version.

    That said, is not really meaningful for the parameter as byref (i.e. input/output) in this case, execution is already a type of reference data interface. Thus, passing byref implies that the method has the possibility of replacing the object that points to RunState.Execution with another object of execution that very probably is not something of the method would make ever.

    To work around this problem, you can do the following:

    (1) changing the prototype of the method (or add a new overload) to take the run by value setting (i.e. only), which is probably what that the author of the code really the intention anyway.

    Or

    (2) create a local variable of type object reference and assign RunState.Execution before your call to the method, and then pass the local variable for the byref parameter.

    Please let us know if you have any questions or if workarounds are not enough for you.

    Hope this helps,

    -Doug

  • work on deleting the object from the persistent store.

    Hello

    I use permanent storage to store custom objects, I am able to save, retrieve, and update object. I'm ranger object persistent using State figure "obj" below.here is my custom object that implements Persistable interafce.

    PersistentObject store = PersistentStore.getPersistentObject (0xa1a569278238dad2L);

    store.setContents (obj);

    Store.Commit ();

    But, when I'm trying to delete 'obj' to permanent storage, I found it is ignored, I use possible subsequently remove the object

    permanent storage.

    PersistentStore.destroyPersistentObject (0xa1a569278238dad2L);

    but when I try to get again in my code by using the following statement

    MyObject obj = store.getContents ();

    I get all the properties of 'obj', is there a programmatic way to destroy the object of permanent storage? or is it expected behavior?

    Make sure that you not only remove the store, but also get the new PersistentObject object thus:

    PersistentStore.destroyPersistentObject (key);

    PersistentObject persistObj = PersistentStore.getPersistentObject (key);

    Object myObject = persistObj.getContents ();

    If this does not work then you might have some problems with synchronization - remove any synchronization around this code and check again.

    See you soon

    Nik

  • Why can't change size and move the object when I do the pdf a document from windows?

    I got my shipping label that came in a .pdf file to a .doc because it had to be smaller than what was sent to me.  But now I can't modify the object, there is no transfer as a single item, each piece of the shipping label needs to be moved.  Are there not an easiest way without having to pay more money once more.  I've already paid to be able to transfer PDF to doc but it is pretty useless, and I would like to just get my money back!

    The exported content reflects what the PDF Creator has pushed into the PDF. What you're saying, it seems the PDF creator uses a routine of PDF creation poor or provided an image that has been put in the PDF file.

    If the PDF file is just an image (or policies described, which are essentially a fancy characters image) then what is exported image. The export of 'chunks' can cause a 'source' image that is formed by "pieces".

    So, you paid for the export capacity & that's what you have.

    Basically, you want to get a better quality PDF.

    Be well...

  • Make the display of the object performance stick?

    Is it possible to make the object to show stick performance level? I have some logos that sounds weird to typical display, so I changed their object-> display-> display of high quality performance.  Only I can't find a way to save this configuration (when I save and reopen the document, they started setting usage view).  Is it possible to save this setting?

    Thank you, Phyllis

    Select Configuration preserve object-level display in the preference and make sure that you apply the quality to the object and save doc. Next time you open, only objects of high quality applied will display that way.

  • I have a pdf file and I need to convert to word to modify the document.  Is this possible?

    I have a pdf file and I need to convert to word to modify the document.  Is this possible?

    As far as I know, this is not possible with just the free reader. You will need Acrobat or one of its associated services.

  • To display the Panel of the accordion and to modify the text inside at the same time, is it possible?

    What I want to do is change the text on the component - button, which is in a container - accordion, but I always fail at first, flex reports error "null." I'm clear on the reason, because I have never
    initialize that accordion, but hopefully show the accordion panel and modify the text
    Furthermore, is it possible?
    It will be appreciated any suggestions in this regard.

    "augur_guan" wrote in message
    News:g7uoo9$c7r$1@forums. Macromedia.com...
    > What I want to do is change the text on the component - button, which
    > is in
    > a container - accordion, but I always fail at first, flex reports
    > "null" error. I'm clear on the reason, because I have never
    > initialize the accordion, but hopefully show the accordion panel and change
    > the
    > text to
    > also, is it possible?
    > It will be appreciated any suggestions in this regard.

    If you don't care startup performance, you can set the creationPolicy
    on the accordion at all. Otherwise, you can try either using a test
    (like creationComplete on the button) or use data binding to 'pull' data
    in the button once it is initialized.

    HTH;

    Amy

  • Possible to replace the CPU on Satellite A200 - 1 H 2?

    Can I replace my cpu (Toshiba Satellite A200 - 1 H 2) by another? Because I know that some laptops can do that.

    Hi mate,

    first of all, if you want to lose your warranty, then replace it. And I could give you more than 10 arguments why not do it because if you´re not familiar with disassembly of laptops and without machine´s hardware information you cannot exchange it.

    So generally it s is NOT possible, perhaps with other brands but I think that other brands manufacturers do the same thing as toshiba and will revocate the guarantee of the machine if you open your machine and you try to modify the materials 'wired' inside your laptop.

    Welcome them

Maybe you are looking for