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

Photoshop Script error - desperate for help!

Community Beginner ,
Jul 27, 2018 Jul 27, 2018

Hi and thanks for the help in advance!

We wrote a PS script application and have successfully ran it on two of our PCs.  However, on our client PC, which is Windows 7 Enterprise, it throws the following error:

- The parameters for command "Make" are not currently valid. At Photoshop.Documents.Add(Object Width, Object Height, Object Resolution, Object Name, Object Mode, ObjectInitialFill, Object PixelAspectRation, Object BitPerChannel, Object ColorProfileName"

It's basically just trying to create a new document. Simple.  Because their PC is on ActiveDirectory, we thought there might be a problem with permissions/rights.  We ensured that 'Everyone' had full control on the folder.  Doesn't seem to work. I also ensured that all permissions were applied to the Adobe Photoshop application folder, temp directory, and the general 'Adobe' folder under 'Program Files'.  All users have 'Full control'.

Additionally, we double-checked that they're running the same version of Photoshop (they are using an enterprise license, but it's the same version).

So, the question is, does anyone know if ActiveDirectory would interfere with the Photoshop.Documents.Add function or any suggestions on what to look for?  We're racking our brain to figure this out!!  Frustrating when it works on our systems, but not a client!! 

Thanks!

Doug

TOPICS
Actions and scripting
6.3K
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

LEGEND , Jul 27, 2018 Jul 27, 2018

If you use wrong input by native DOM method to create document you will be alerted of same error:

displayDialogs = DialogModes.NO, $.level = 0; try{documents.add(0)}catch(err){alert(err.message)}

If your client use other Photoshop release maybe last parameter i.e. color profile is lacking in his Ps version to be set.

If he had rulers set to percents then document couldn't be created as well, but then you would get other error description.

Best way is do what I suggested, you may also try with no par

...
Translate
Adobe
LEGEND ,
Jul 27, 2018 Jul 27, 2018

See if the same works with Javascript (btw there is quotaion mark at end instead of closing parenthesis):

Photoshop.Documents.Add(Object Width, Object Height, Object Resolution, Object Name, Object Mode, ObjectInitialFill, Object PixelAspectRation, Object BitPerChannel, Object ColorProfileName"

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 27, 2018 Jul 27, 2018

Photoshop is not a file editor. Photoshop edits documents and there is no file backing a new document it would not have been saved yet. A new document would only be in the Photoshop application till you save it or there is a recovery psb created for it.  It only has a document name till you save a file using a Photoshop save.  I do not think an active directory would have any involvement when you create a new document. Only would be involved if you open an old document  that is backed in your active directory.

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
People's Champ ,
Jul 27, 2018 Jul 27, 2018

Not enough information.
Who gives this error? Can you show a screenshot, or the exact text of errors, or better the whole script? Is the script a JSX file? Which version of Photoshop?

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 27, 2018 Jul 27, 2018

Thanks everyone for the help!

Attached is the prompt error from our application "Renderbot".  At the top of is all Tensorflow stuff so you can ignore that.

Photoshop CC 2018 19.1.5  Our application is written in C#.  Again, it works on our PC's, just not one that's at the client which is on Active Directory.

error.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
People's Champ ,
Jul 27, 2018 Jul 27, 2018

I dont know. It probably has nothing to do with scripts. I can not help.

Maybe someone who understands what you are talking about

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
LEGEND ,
Jul 27, 2018 Jul 27, 2018

It seems those applications you mentioned scan internet looking for codes and resources and then translate to your lang?

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 27, 2018 Jul 27, 2018

So yes, Tensorflow is a Google API that is used for Machine Learning/AI.  However, we've checked that feature and it works just fine. It's somewhere when our app calls Photoshop.Document.Add

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
LEGEND ,
Jul 27, 2018 Jul 27, 2018

Could you alert all inputs used to create new document - just a second before document had to be created? If it can not be created it's probably because one / more inputs was read differently than should for some reason, so like on your machine.

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 27, 2018 Jul 27, 2018

So Visual Studio is installed on the machine and we've gone through the debugger.  We'll try more alerts but basically it stops right on that error.

I'm going to try to just get a fundamental script going to see if it can at least create a new document outside our program.

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
LEGEND ,
Jul 27, 2018 Jul 27, 2018

If you use wrong input by native DOM method to create document you will be alerted of same error:

displayDialogs = DialogModes.NO, $.level = 0; try{documents.add(0)}catch(err){alert(err.message)}

If your client use other Photoshop release maybe last parameter i.e. color profile is lacking in his Ps version to be set.

If he had rulers set to percents then document couldn't be created as well, but then you would get other error description.

Best way is do what I suggested, you may also try with no parameters, then with first, first two, and so on adding one till fail.

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 27, 2018 Jul 27, 2018

Thank you!  It was due toe the rulers not being set properly!

Kukurykus, thank you so much for your time.  You saved me hours more of aggravation and frustration!

We're Machine Learning/AI practitioners so not knowing these nuances of Photoshop can hinder us.

Doug

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
LEGEND ,
Jul 27, 2018 Jul 27, 2018

It seems my experience with scripting is valuable Set the answer as correct solution then

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
People's Champ ,
Jul 28, 2018 Jul 28, 2018

At me somehow works without errors at any quantity of arguments in documents.add () and at rulerUnits = Units.PERCENT.

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
Guide ,
Jul 28, 2018 Jul 28, 2018

For me it fails silently if I don't change from Percent.

using System;

namespace PhotoshopTest

{

    class Program

    {

        static void Main(string[] args)

        {

            dynamic app = Activator.CreateInstance(Type.GetTypeFromProgID("Photoshop.Application"));

            app.Visible = true;

            app.Preferences.RulerUnits = 1; //Pixels

            app.Documents.Add(3000, 2000, 72, "Temp File", 2 /* NewDocumentMode.RGB*/, 1 /* DocumentFill.WHITE*/, 1);

        }

    }

}

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
People's Champ ,
Jul 28, 2018 Jul 28, 2018

I do not know in what language this is written, but in jsx it is incorrect to specify 3000.


Correctly - UnitValue (3000, "px")

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
Guide ,
Jul 28, 2018 Jul 28, 2018

It is written in C#  the same as the original posters language he is using.

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
LEGEND ,
Jul 28, 2018 Jul 28, 2018
LATEST

When Rulers are set to cm, mm, pic or pt and you are trying to create document with below code then it's going to fail as well as when you used higher values (appropriatery different for each of mentioned). It will fail also for percents, but then you're getting 'Illegal Argument' error:

$.level = 0; try{displayDialogs = DialogModes.NO, documents.add(1,1,1)}catch(err){alert(err.description)}

btw what is difference in Error description and message. I noticed sometimes they are different but mostly the same, so?

I found it here: UI: Remember last path entered

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