Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

app.open() is not a function

Community Beginner ,
Jul 15, 2015 Jul 15, 2015

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

TOPICS
Actions and scripting
4.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Jul 16, 2015 Jul 16, 2015

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

Translate
Adobe
Community Expert ,
Jul 15, 2015 Jul 15, 2015

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.

JJMack
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 15, 2015 Jul 15, 2015

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 16, 2015 Jul 16, 2015

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 16, 2015 Jul 16, 2015

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 16, 2015 Jul 16, 2015

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 16, 2015 Jul 16, 2015

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!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 16, 2015 Jul 16, 2015

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 16, 2015 Jul 16, 2015

Yes.

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 03, 2017 Feb 03, 2017
LATEST

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" ));

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines