Skip to main content
Inspiring
December 27, 2024
Answered

ExtendScript: how to get screens size?

  • December 27, 2024
  • 3 replies
  • 1464 views

Hello,

 

I'm trying to get working an old jsx script + applescript that split my main screen with the two frontmost Photoshop documents - it was very useful for comparing two documents.
This script worked with an old Photoshop CS6 but it gives an error on Photoshop 2025 when I try to retrieve my screen sizes.
I was using :

app.getCustomOptions('screensSize').getString(0)

Do you know any Photoshop 2025 compatible equivalent?

This topic has been closed for replies.
Correct answer r-bin

Sorry, I forgot to answer your question. This is a part of my script and the results.

	var myProp = 'screensSize';
	var myString = 'Hello';
	var desc = new ActionDescriptor();
	app.putCustomOptions(myProp, desc, false);
	
	alert(app.getCustomOptions('screensSize')); // --> [ActionDescriptor] : [count]'0' [typename]'ActionDescriptor'
	alert(app.getCustomOptions('screensSize').getString(0)); // --> ERROR 8500 : property doesn't exist

I'll try with your links.


quote

Sorry, I forgot to answer your question. This is a part of my script and the results.

 

	var myProp = 'screensSize';
	var myString = 'Hello';
	var desc = new ActionDescriptor();
	app.putCustomOptions(myProp, desc, false);
	
	alert(app.getCustomOptions('screensSize')); // --> [ActionDescriptor] : [count]'0' [typename]'ActionDescriptor'
	alert(app.getCustomOptions('screensSize').getString(0)); // --> ERROR 8500 : property doesn't exist

 

I'll try with your links.


By @frmorel

First, you use getString(), but I don't see putString().

Second, don't use 0 for the key(id) argument.   more 

 

3 replies

c.pfaffenbichler
Community Expert
Community Expert
December 28, 2024

Did you »app.putCustomOptions(…« before trying to get them? 

Otherwise there being nothing to retrieve seems logical. 

 

Please post screenshots illustrating what you mean exactly. 

If you (understandably for a Mac-user) don’t want tabs please disable them via the Preferences (»Open Documents as Tabs« and QEnable Floating Document Window Docking«). 

frmorelAuthor
Inspiring
December 28, 2024
app.getCustomOptions('screensSize')

returns "error 1302" -> Nonexistent element

These are some screen captures:

 

1 - initial demo state (please note the order of the windows : car and cat are the two frontmost documents)

 

 

 

2 - what I want (what I had in CC6!) - dog document has not been affected, it is below the others

 

 

 

3 - what I have with Arrange > 2-up Vertical - note the tab (though open docs in tabs is not checked in the settings)

 

c.pfaffenbichler
Community Expert
Community Expert
December 28, 2024
quote

3 - what I have with Arrange > 2-up Vertical - note the tab (though open docs in tabs is not checked in the settings)

But is »Enable Floating Document Window Docking« checked? 

Edit: Never mind, apparently the Preferences settings are disregarded when invoking those arrangements. 

 

Again: Did you putCustomOptions

If not what would be there to retrieve? 

I suspect you set this up when installing the Script/s originally on CS6 and you would have to do the same for 2025. 

Participant
December 28, 2024

its nice I like that script.. but I don't know the compatible thing.

 

Online gamer

Inspiring
December 27, 2024

If I understand correctly, do you need this?

frmorelAuthor
Inspiring
December 28, 2024

Thank you for your answer.

 

Yes, this kind of display.
But better:
- I would like only the windows of the two frontmost documents to be modified
- I would also like the windows of any other documents not to be placed in tabs

Inspiring
December 28, 2024

you could put a screenshot of what you would like.