Hi
I thought it was about time I contributed back on here, and share a quick tip I stumbled accross.
I have attached a screen shot of a dialog to select different scripts from, but you may notice the top text looks bold.
To make the text appear bold, simply repeat the line of code:
myText = myMainPanel.add('statictext',[15,15,260,34.5],'Choose the mailer to run the script for');
myText2 = myMainPanel.add('statictext',[15,15,260,34.5],'Choose the mailer to run the script for');
Anyway, just thought I'd share that with you.
Roy
Cute!
FWIW, the "official" way to use a bold font is like this:
var font = myMainPanel.graphics.font.family;
var fontSize = myMainPanel.graphics.font.size;
var boldFont = ScriptUI.newFont (font,'BOLD',fontSize);
var myText = myMainPanel.add('statictext',[15,15,260,34.5],'Choose the mailer to run the script for');
myText.graphics.font = boldFont;
Harbs
Here is some Rapid ScriptUI code
var rapidDlg = new Window('dialog',"Bold",undefined);
buildWindow();
rapidDlg.show();
function buildWindow(){
// Properties for rapidDlg.StaticText1
rapidDlg.StaticText1 = rapidDlg.add('statictext',undefined,"Lets Be Bold");
rapidDlg.StaticText1.graphics.font = ScriptUI.newFont(rapidDlg.StaticText1.graphics.font.family,"BOLD",rapidDlg.StaticText1.graphics.font.size);
// Properties for rapidDlg.Panel1
rapidDlg.Panel1 = rapidDlg.add('panel',undefined,"I'm Bold on a mac");
rapidDlg.Panel1.graphics.font = ScriptUI.newFont(rapidDlg.Panel1.graphics.font.family,"BOLD",rapidDlg.Panel1.graphics.font.size);
// Properties for rapidDlg.Panel1.Button1
rapidDlg.Panel1.Button1 = rapidDlg.Panel1.add('button',undefined,"Hey Bold fellow");
rapidDlg.Panel1.Button1.graphics.font = ScriptUI.newFont(rapidDlg.Panel1.Button1.graphics.font.family,"BOLD",rapidDlg.Panel1.Button1.graphics.font.size);
}
This is what it looks like on Windows XP SP3 using CS4 & CS5
if I remember correctly it does show correctly on the mac
even this doesn't work
var rapidDlg = new Window('dialog',"Bold",undefined);
buildWindow();
rapidDlg.show();
function buildWindow(){
// Properties for rapidDlg.StaticText1
rapidDlg.StaticText1 = rapidDlg.add('statictext',undefined,"Lets Be Bold");
rapidDlg.StaticText1.graphics.font = ScriptUI.newFont("Arial","BOLD",rapidDlg.StaticText1.graphics.font.size);
// Properties for rapidDlg.Panel1
rapidDlg.Panel1 = rapidDlg.add('panel',undefined,"I'm Bold on a mac");
rapidDlg.Panel1.graphics.font = ScriptUI.newFont("Gill Sans Ultra Bold","Regular",rapidDlg.Panel1.graphics.font.size);
// Properties for rapidDlg.Panel1.Button1
rapidDlg.Panel1.Button1 = rapidDlg.Panel1.add('button',undefined,"Hey Bold fellow");
rapidDlg.Panel1.Button1.graphics.font = ScriptUI.newFont("Gill Sans Ultra Bold","Regular",rapidDlg.Panel1.Button1.graphics.font.size);
}
looks like this
which means that the font object is not wired at all for panel on Windows
Wow, thanks for the cool input. Harbs, I Checked out Kris' post. Most interesting. What I have ended up doing is making an Applescript app in Xcode. Saved as a floating window, gave it a cool icon, and it looks, and works good. I still feel I have cheated taking this route, as it takes 5 mins to throw this together with only a single doscript line of code in Applescrip to trigger my long scripts. Still, it works. Thanks all again for your help Roy
North America
Europe, Middle East and Africa
Asia Pacific
Copyright © 2012 Adobe Systems Incorporated. All rights reserved.
Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy (updated 07-14-2009).