0

What is Vbscript syntax to determine document color mode?

Regards to the posted answer:

I figured it out. Basically the same as your codes. I did not enumerate like you did. I was just interested in getting the returned long value.

So mine was:

Dim mode as long Dim ObjApp

    set objApp = CreateObject("Photoshop.Application") mode = objApp.Activedocument.mode Rem ---------- Immediate test ---------- debug.print mode

I like your enumeration technique. I will put it to use.

3
  • 4
    1) It appears you have two accounts and that is frowned upon, please contact SE to have both merged. 2) This is a question and answer site, if you would like to discuss beyond the answer please take that to chat. 3) if you did use some parts of his answer it is customary to accept his answer so he can get his due rep for helping. By doing so that encourages people to answer your question. Beyond that I've edited your question to include the removed answer you provided.
    – user9447
    Feb 4, 2019 at 13:10
  • Sorry about that. I was asked to create a new account whne I tried to post a question. How can I contact SE to merge my accounts?
    – Lnfortun
    Feb 6, 2019 at 18:04
  • Contact.
    – Welz
    Feb 8, 2019 at 12:50

1 Answer 1

1

Syntax does not mean what you think it means. There is no syntax for determining color mode. But yeah document objects have a property that is surprisingly named 'Mode'.

dim app

set app = CreateObject( "Photoshop.Application" )

dim msg
dim mode
dim niceNames
niceNames = Array(_
   "","Grayscale","RGB","CMYK","Lab","Bitmap",_
   "Indexed","MultiChannel", "Duotone")

mode = app.ActiveDocument.Mode 
msg = mode & " means color mode is: " & niceNames(mode)
MsgBox(msg )

Names subject to change form Photoshop version to other.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.