Copy link to clipboard
Copied
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
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
...Copy link to clipboard
Copied
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"
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
I dont know. It probably has nothing to do with scripts. I can not help.
Maybe someone who understands what you are talking about
Copy link to clipboard
Copied
It seems those applications you mentioned scan internet looking for codes and resources and then translate to your lang?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
It seems my experience with scripting is valuable Set the answer as correct solution then
Copy link to clipboard
Copied
At me somehow works without errors at any quantity of arguments in documents.add () and at rulerUnits = Units.PERCENT.
Copy link to clipboard
Copied
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);
}
}
}
Copy link to clipboard
Copied
I do not know in what language this is written, but in jsx it is incorrect to specify 3000.
Correctly - UnitValue (3000, "px")
Copy link to clipboard
Copied
It is written in C# the same as the original posters language he is using.
Copy link to clipboard
Copied
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
Find more inspiration, events, and resources on the new Adobe Community
Explore Now