Copy link to clipboard
Copied
ok.. another question:
how tho check if selection is any kind of text:
if (app.documents.length != 0 && app.selection.length != 0 &&
(app.selection[0].constructor.name=="Text"||app.selection[0].constructor.name=="Paragraph"))
but sometimes selection is "textStyleRange", sometimes is "character" etc. is there any shortcut to check everything at once?
I usually do something like this:
if ( app.documents.length && app.selection.length && app.selection [ 0 ].hasOwnProperty ( 'baseline' ) )
alert ( "It's a text!" );
Hope that helps.
--
Marijan (tomaxxi)
Copy link to clipboard
Copied
I usually do something like this:
if ( app.documents.length && app.selection.length && app.selection [ 0 ].hasOwnProperty ( 'baseline' ) )
alert ( "It's a text!" );
Hope that helps.
--
Marijan (tomaxxi)
Copy link to clipboard
Copied
thanks. that's brilliant!
it works