Photoshop CS5 not recognising activeDocument

假装没事ソ 提交于 2019-12-02 05:57:12

问题


I wrote a quite big script for Photoshop CS5.1 on my 64bit Vista machine. Now when I run the very same script on my new 64bit Windows 7 machine, Adobe ExtendScript Tool complains about activeDocument (no such element) in this simple script:

#target photoshop
var pDoc = app.activeDocument;
alert("Done!");

I have tried both and without #target and choosing the target in the ExtendedScript Tool. Is there something I have missed, or do I need to install something more. I only installed the 64bit version of Photoshop. Is it so that the 32bit Photoshop has the script extensions?

I don't see why I need to install both 32bit and 64bit versions if I'm only going to use the 64bit version.


回答1:


SOLVED
The mystery is solved. It is embarrassing simple if you interpret the error message more careful. Of course I can't get an activeDocument if there are no documents in Photoshop, duh!?! I interpreted it as the statement activeDocument wasn't recognised, but of course if I have no document there is no such element (as a photoshop document) to give me. I'm used to C++ and would expect the reuslt to be a NULL value or similar if there is a problem to get the document... excuses, excuses ;)

Well, if someone else should get into the same problem, here is the answer on my expense :D I will uninstall the 32bit version now...



来源:https://stackoverflow.com/questions/13183285/photoshop-cs5-not-recognising-activedocument

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!