Why is pushing into this array resulting in a general Photoshop error?

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

Wolf_22
Posts: 14
Joined: Tue Nov 24, 2020 7:00 pm

Why is pushing into this array resulting in a general Photoshop error?

Post by Wolf_22 »

So I'm trying to debug some logic I see which was made by someone else. The code is supposed to work when the Count Tool is used and in this specific code, values are being assigned to thePoints array as follows:

Code: Select all

thePoints.push(
	[
		thisOne.getUnitDoubleValue(//0
					stringIDToTypeID("x")
		), 
		thisOne.getUnitDoubleValue(//1
				stringIDToTypeID("y")
		), 
		thisOne.getUnitDoubleValue(//2
				stringIDToTypeID("group")
		), 
		thisOne.getUnitDoubleValue(//3
				stringIDToTypeID("itemIndex")
		)
	]
);
When I debug this, it looks as if it error's-out on the "thisOne.getUnitDoubleValue(stringIDToTypeID("group"))" piece because when I try to prompt() that out, it triggers the same error.

Any ideas what might be causing this? When I print out "stringIDToTypeID("group")", I do get an ID returned... Just not sure why it's not working when sending it into getUnitDoubleValue() when thisOne appears to be a legitimate ActionDescriptor object.

Any ideas about this would be appreciated. I'm trying to use ExtendScript Toolkit to debug all this.