9 Replies Latest reply on Feb 3, 2017 2:34 PM by DevilsChariot

    app.open() is not a function

    chrisr61512424 Level 1

      Hey

      Win7/PS2014x64

       

      At one point recently these scripts worked.  Ive changed other things in the file (there are no clashes for the name "app") but not these functions.

      When I did a test the first time this happend, it would work if there were no other functions in the file.

       

      Now when I try to access the app.someMethod() it says that it is not a function. 

       

      My script loads into extendscript with no errors.  I have photoshop selected as the target in extendscript.

      This happens on at least app.open()  and  app.stringIDtoTypeID()  and app.documents

       

      When it stops on app.open() in the debugger, there is no app object in the data browser, only 2 vars of mine and "this" (which has an app property that is the name of my CEP panel)

      if i stop execution of the script, the app object appears in the data browser

       

      what do I do make sure app is available? a loop that just keeps checking to see if its available?

      is this a bug?

       

      thanks

       

      chris rogers

        • 1. Re: app.open() is not a function
          JJMack Most Valuable Participant

          Why not show the script and describe the document state when you used the script and identify  the someMethod() step that may or may not be valid for the current document state. Show the actual error you receive. And a screen capture showing the Photoshop windows showing Photoshop pallets like the layer and history so we get some idea what your writing about.  Put someContent() into what you write.

          • 2. Re: app.open() is not a function
            pixxxel schubser MVP & Adobe Community Professional

            JJMack schrieb:

             

            Why not show the script and describe the document state when you used the script and identify  the someMethod() step that may or may not be valid for the current document state. Show the actual error you receive. And a screen capture showing the Photoshop windows showing Photoshop pallets like the layer and history so we get some idea what your writing about.  Put someContent() into what you write.

            +1

             

            chrisr61512424,

            did you try the function standalone?

            Are you really sure, that PS the target is?

            appOpen1.png

            appOpen2.png

            appOpen3.png

            • 3. Re: app.open() is not a function
              chrisr61512424 Level 1

              Why not show the script

              Im paid to write code so I cant give you the code I am being paid to write.


              and describe the document state

              No documents


              when you used the script and identify  the someMethod() step

              I clearly state that app.open() (see title of post) isnt working along app.documents and app.stringIDtoTypeID


              with that may or may not be valid for the current document state.

              Again, no documents are open.


              Show the actual error you receive.

              The actual error I receive is the same one I listed in the title of this post:

              app.open() is not a function


              And a screen capture showing the Photoshop windows showing Photoshop pallets like the layer and history so we get some idea what your writing about.

              No documents open.


              Put someContent() into what you write.

              Haha, that's a clever one.

              The problem and the steps to re-create the bug and the application state are all very clearly defined in the original post.


              the app object is not loaded when im tryig to call it, my apologies if this isnt crystal clear already.

              Hopefully a programmer will get back to me about this issue.

              • 4. Re: app.open() is not a function
                chrisr61512424 Level 1

                Well it does seem to be a name clash with CEP.

                when my script stops in the debugger the variable app is the name of the CEP panel and not a reference to application.

                Application() is a function that returns undefined

                 

                Ill try try posting in a CEP specific forum, thanks for your help

                 

                Chris

                • 5. Re: app.open() is not a function
                  pixxxel schubser MVP & Adobe Community Professional

                  chrisr61512424 schrieb:

                   

                  Why not show the script

                  Im paid to write code so I cant give you the code I am being paid to write …

                  … Hopefully a programmer will get back to me about this issue.

                   

                   

                  If you have had paid for the script: Please ask the script author!

                  • 6. Re: app.open() is not a function
                    chrisr61512424 Level 1

                    It was a name clash.

                     

                    The workaround is to declare this outside of a function in the begining of jsx file

                    var theApp = app

                     

                    and use theApp to reference the photoshop app and not the CEP app

                    • 7. Re: app.open() is not a function
                      chrisr61512424 Level 1

                      My apologies if I wasnt completely clear that I am the author that is being paid.

                      • 8. Re: app.open() is not a function
                        pixxxel schubser MVP & Adobe Community Professional

                        Yes.

                         

                        Mostly my english is enough, but not in this case. Now I understand that you are the programmer.

                        • 9. Re: app.open() is not a function
                          DevilsChariot Level 1

                          Just looking into this issue today, so incase someone else needs an answer that works as of January 2017 try this:

                           

                           

                          open(new FIle("path/to/your/file/placed/here"));

                           

                          ie:

                           

                          open(new File("/Users/crs/Desktop/dvd_standard_litho/shine.psd" ));