Sg2.9
typeof, constructor etc
Recent RSS
typeof, constructor etc
Date:  30. April 2012, 13:11

What is used to determine the kind of a selected item?
I need to distinguish a path from a group or a text item.

In my tests, constructor.name gives 'Object' and typeof x is 'undefined'.

The error messages give 'object PointText' etc ... but where is this stored?

  • ---

After much experimenting I find that
thing.constructor.toString.split(' ')[0]
gives me what I want for some cases ... but it does not seem to give Circle etc.

Any better ideas?

Scripts
08.08.14, 15:24
15.05.14, 14:23
02.03.14, 19:16
18.11.13, 14:48
22.03.13, 03:05
22.02.13, 15:45
Posts
10.01.17, 16:37
19.02.16, 06:03
19.02.16, 06:00
17.01.16, 11:00
12.01.16, 13:10
25.11.15, 08:19
Script of the Moment
rot3d 24.05.09