Photoshop CS - Make Current document the Current document

Okay this is embarrassing.
But I just can’t seem to figure this out.

How can I make a Photoshop document the active Photoshop document when there are many open documents. I looked through the AppleScript dictionary and couldn’t find the command for this?

For example, I am duplicating documents based off of the current document or document 1. Therefore after the duplication the “once current document” is no longer the active document. I want to target that once current document to be the current document once again.

Thanks,
Jeff

Photoshop is a strange one, can’t set index (read only), can’t set frontmost (read only). You can set the current document object, there’s the answer.

tell application "Adobe Photoshop CS"
	activate
	set current document to document 1 -- First document open not frontmost
	set current document to document "Original" -- Choose by document name
end tell

Have fun.

I wished I would have posted my question many hours earlier. I was pulling my hair out. I am extremely glad you were kind enough to give me the solution. My script is now working perfectly.

Thank you again.

-Jeff

Always best to make reference to the document straight after opening it so you know its the current document. From then on its pretty staright forward.