Skip to main content
chrisr61512424
Inspiring
July 15, 2015
Answered

app.open() is not a function

  • July 15, 2015
  • 2 replies
  • 4830 views

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

This topic has been closed for replies.
Correct answer chrisr61512424

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


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

2 replies

Known Participant
February 3, 2017

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

JJMack
Community Expert
Community Expert
July 16, 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
pixxxelschubser
Community Expert
Community Expert
July 16, 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?