Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Script UI font-style on static text not working? [CC2014.1]

Explorer ,
Mar 25, 2015 Mar 25, 2015

Hi,

Since we upgraded to CC2014 I had to rework some of our interfaces because of weird behavior, like event binded with addeventlistener not triggering or toggling text not displaying when resizing the window, now this time it's more simple and I can't understand why such simple thing is not working.

One of our interfaces has a statictext which is supposed to be bold, but for the life of me I can't make it bold.

Anyone one had success with making a static text in bold in CC2014.1?

Thanks

TOPICS
Scripting
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guru , Mar 26, 2015 Mar 26, 2015

Hi Eric

see ID CC SUI - Insane Daft Crazy Cuckoo Stupid Useless Idiotic

I wrote the post after trying CC out for about 20 minutes which was a bit unfair  and there's  quite a few inaccuracies there but the general picture is correct.

In short don't expect to see the SUI pen issues fixed within your grandchildren's  life time, it might happen but then so might a lot of things happen by then.

A lot of the events got messed up also, if you post some code you might get a solution here.

Trevor

Translate
Guest
Mar 25, 2015 Mar 25, 2015

What does this static text mean. Is it the one which is not tagged?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 25, 2015 Mar 25, 2015

I'm talking about the Script UI class StaticText
Adobe InDesign CS6 (8.0) Object Model JS: StaticText (SUI)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Mar 26, 2015 Mar 26, 2015

Hi Eric

see ID CC SUI - Insane Daft Crazy Cuckoo Stupid Useless Idiotic

I wrote the post after trying CC out for about 20 minutes which was a bit unfair  and there's  quite a few inaccuracies there but the general picture is correct.

In short don't expect to see the SUI pen issues fixed within your grandchildren's  life time, it might happen but then so might a lot of things happen by then.

A lot of the events got messed up also, if you post some code you might get a solution here.

Trevor

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 26, 2015 Mar 26, 2015

Hi Trevor,

I did come across your post and I'm baffled at how they could break so much things.

Here is a simple window that will demonstrate my problem. In CS55 this work as intended, but in CC2014 both text don't have bold.

var wBoldTest = new Window('dialog',"Bold Test",undefined);

buildWindow();

wBoldTest.show();

function buildWindow(){

  // Properties for wBoldTest.lblNotBold

  wBoldTest.lblNotBold = wBoldTest.add('statictext',undefined,"This is not in Bold");

  // Properties for wBoldTest.lblShouldBeBold

  wBoldTest.lblShouldBeBold = wBoldTest.add('statictext',undefined,"This should be in bold.");

  wBoldTest.lblShouldBeBold.graphics.font = ScriptUI.newFont(wBoldTest.lblShouldBeBold.graphics.font.family,"BOLD",wBoldTest.lblShouldBeBold.graphics.font.size);

}


Here is what it look like in CS5.5

boldcs55.jpg

Here is what it look like in CC2014.1

boldcc2014.jpg

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Mar 26, 2015 Mar 26, 2015

As a said, no real hope on the bold issue.

It's the event issue I was suggesting you post the code.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 26, 2015 Mar 26, 2015

I manged to figured this out a while ago.  Some of the interface we had were still working as intended so by comparing those that worked with the one that didn't I saw the difference on how they were binding the event.

So something like this in CC2014 don't work anymore

w.bHelloWorld.addEventListener("click", function(){alert("Hello World");};

and need to be replace by this

w.bHelloWorld.onClick = function(){alert("Hello World");};

I just assumed that it was the new way of binding event and that addEvenListener must have been deprecated, but now I understand they just messed it up.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Mar 26, 2015 Mar 26, 2015
LATEST

Use mousedown or mouseup instead of click.

On some object there's a difference between Mac and Windows for which one you need to pick

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines