Changing font in Pages table

I can change the font and size in the body of a Pages '09 document with the following script:
tell application "Pages"
tell document 1 to tell body text
set font name to "Times"
set font size to 14
end tell
end tell
But, it won't change the font inside a table, which is what I want.
I have tried this script:
tell application "Pages"
tell document 1 to tell table text
set font name to "Times"
set font size to 14
end tell
end tell
Which produces this: -- error "Pages got an error: Can’t make text into type integer." number -1700 from text to integer
Any help appreciated.

After many trials and errors, I didn't find any better way to open the "Blank" template than to open its file directly (/Applications/iWork '09/Numbers.app/Contents/Resources/Templates/Blank.nmbtemplate).
So here's an improved version of the script that should now work properly for anybody (at least I hope so):
--BEGINNING OF SCRIPT:
tell application "Pages"
launch
make new document at front
tell body text of front document
set alignment to center
add table
set shadow of table 1 to true
select table 1
end tell
activate
tell application "System Events" to keystroke "c" using command down -- copy to the clipboard with ⌘C
end tell
tell application "Numbers"
--Open the "Blank" template:
open POSIX file "/Applications/iWork '09/Numbers.app/Contents/Resources/Templates/Blank.nmbtemplate"
activate
--Paste table 1 into a new Numbers document:
tell application "System Events"
set theSheets to outline 1 of scroll area 1 of splitter group 1 of splitter group 1 of window 1 of process "Numbers"
select row 1 of theSheets -- sheet 1
select row 2 of theSheets -- table 1 of sheet 1
key code 51 -- delete key
keystroke "v" using command down -- paste the contents of the clipboard with ⌘V
select row 1 of theSheets
end tell
--Change the contents and format of the second row of the table:
tell table 1 of sheet 1 of front document
set value of cell 4 to "Isn't"
set value of cell 5 to "that"
set value of cell 6 to "nice?"
set font name of row 2 to "Times"
set font size of row 2 to "24"
set text color of row 2 to {65535, 0, 0} -- red
set alignment of row 2 to center
end tell
--Copy the modified table to the clipboard:
tell application "System Events"
select row 2 of theSheets -- table 1 of sheet 1
keystroke "c" using command down -- copy to the clipboard with ⌘C
end tell
quit without saving -- optional
end tell
tell application "Pages"
activate
tell application "System Events" to keystroke "v" using command down -- paste with ⌘V to change table 1
end tell
--END OF SCRIPT

Similar Messages

  • Change Font Size for Table Column

    Hi,
    How can we set different font sizes for table columns?
    Thanks,
    Uma.A

    Hi
    Set Design property of table column
    Aslo check this link
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/66/18b44145143831e10000000a155106/frameset.htm
    Thanks

  • Changing font in page name

    How does one change the font of the page name (such as Welcome, About Me, Photos, etc.)? I can rename the page, but font type and size remain fixed. Is that an iWeb limitation or am I missing something?
    Cheers,
    Reb

    don't think your missing anything. not directly though iweb currently. maybe in an update.
    it would be nice

  • Changing fonts in tables

    Hi,
    I want to change font in a table. It's the only item in the document. Selecting all, and changing font doesn't change anything. It does change any text I subsequently type outside the table, but not the table itself. Adding another row to the table uses the table font. Selecting an individual cell before changing font doesn't change anything either. Selecting the text within the cell before changing font does work, but it would be time consuming to do the whole table like this.
    Hope you can help,
    Tris.

    DennisG wrote:
    Tris,
    After I read your post, I tried changing typefaces in a table, and it's not as intuitive as it should be.
    My favourite word processor, TechWriter, uses a menu so you can choose what aspect of the text you want to select at the point at which the caret is, be it Document or Chapter, down to Table row or Table cell.
    But there's a method that worked well for me. Double click on the first cell to select it. Hold down the Shift key, then click on the last cell. The whole table should be selected. Now change the typeface.
    Works for me, thanks. I'd still like to know how to inspect the style for the table though.

  • Change font programmat​ic in a table

    Hey,
    is it possible to change font in a table at Runtime. In my application I have various lines of data representing in a table.
    Problem: How many lines to initialize with different font and font-size.
    Thanks for help
    geotos

    Hello Geotos,
    Unfortunately, the current version of LabVIEW does not support this feature.
    But you are not the first requesting this functionality, so chances are very good that it is included in the next release (LabVIEW 8).
    Best regards
    Ingo Schumacher
    Systems Engineer Sound&VibrationNational Instruments Germany

  • Can anyone help me change fonts and size on my page? I don't understand the class questions?

    Can anyone help me change fonts and size on my page? I don't understand the class questions? All I want to do is change the font and size of a table or div.
    http://www.allgearinc.com/AG12SSWL-Swift.htm -One problem page

    If you want to change the fonts of the entire page then this code will do the trick:
    body {
        font-size: 16pt;
        color: silver;
         font-family: whatever, goes, here;
    If you want to change the fonts of ALL tables on a page then the code is something like this:
    table {
        font-size: 20pt;
        font-family: "Courier New", Courier, monospace;
        font-style: italic;
        font-weight: bold;
    what exactly do you want to change?  Can you be a bit specific so that Ben or Ken can give you the exact code and tell you about the short-hand method to write the code in one line.
    Have you bought a book on CSS yet?  If not, it is a good idea to get one as a reference.  Eric Meyer writes good books on CSS.

  • How to change font size on web page when have no icon in View tool to do so

    menu bar at top of screen does not have icon to change font size of a web page as described in your support information--you show it as between stop and reload in View icon and I do not have it at all in my toolbar.

    See this: <br />
    https://support.mozilla.com/en-US/kb/Page+Zoom

  • How to change font size in a table?

    How to change font size in a table without using the font style of another document?  Please show a sample script.  Thanks!

    Hi Dave,
    Thank you so much for the email.  I tried every object and method I can
    posibly think about such as
    myTable.Rows.Item(1).PointSize = 24
    myCell.Characters.Item(1).PointSize = 24
    I got error message all the time.  These objects don’t support PointSize.
    All I need is to change point size of the text in InDesign tables created
    using VBScript. Could you help me with this?  Thanks,
    Regards,
    Li

  • How to change default font in Pages?

    how do we change the default font for Pages??

    Usually create your own template using the font you want in the Styles.
    What version of Pages are you referring to?
    Peter

  • A mode to change font size and bold in every page?

    Due to problems described here https://support.mozilla.org/en-US/questions/1012057?esab=a&s=&r=0&as=s I have clear that I need something (an extension, maybe) that allow me to recognize and change font size and bold of the fonts in every page.
    Does exist something like this?
    Maybe also for bookmarks toolbar...

    Hi RichterB,
    You can change this in the Content Settings of Firefox. Go to "3 bar" menu and click on Options. Click on content and uncheck "Let websites choose their own styles" and select a bold font type.
    Also try [https://addons.mozilla.org/en-US/firefox/addon/stylish/ Sytlish].

  • In Aperture Books, changes to Master Page FONTS don't get applied to pages?

    In making a book in Aperture, I can change the font in a Master Page (or create a new Master Page with the font I like), but when I try to apply the changed/new Master Page to any given page in the book, the font I want doesn't show up.  It's still there in the Master Page, but doesn't get applied.  I've seen the thread on a related subject from 2008, but the one work-around proposed there is over my head, technically.  Is there anything new to help me in 2012?

    What happens when you perform an Apply Master Pages operation?
    Format > Page Layout > Apply Master Pages

  • Auto Page Number Change Font or Delete?

    After translation from Word to Pages, the auto page number font causes the third digit of the page number to appear outside margin of header.  How can I change font or delete and put in new page number?

    Usually the page numbering from Word are have objects that are not selectable. That is until you have made them selectable by going  Arrange > Make background object selectable. You might need to go Format > Advanced > Make Master object selectable  too.
    Delete them and use Pages version instead, Insert > Page Number

  • Is there a way to change the default page attributes (font, margins, etc) in Pages or do I have to change them every time I open a new document?

    Is there a way to change the default page attributes (font, margins, etc) in Pages or do I have to change them every time I open a new document?

    I never even thought of that - Word woman that I was!  Thanks so much - I shall give it a go!!

  • Font size in Keynote and Pages Table on IPAd

    I imported some keynote presentation into iPad and was horrified to see all my tables with text entries got totally screwed up. After a brief investigation, I discovered that on the iPad if you create a table your are limited to 4 text sizes (L, M, S and Tiny, just like bathing suite sizes). Even the Tiny size is too big for the tables I use.
    Any ideas on how I can use regular font sizes in tables (like 12, 10 8 and so forth)? Am I missing something here? Any help will be appreciated!

    Not if you restore from a backup you've made on iTunes.  All the settings, etc. will be the same.  Of course, there may be corrupted files in the backup that are causing your crash.  Give it a try and see what happens.

  • How to change font size in Interactive report

    Hi I am using Apex 4.02 version I need to get all reports into single page but it displayed excess the page limit. Example If report having more than 15 columns it should display in single page so I tried "break" option in all report column headers still it exceed the page. Can any one help me for this ..?
    How to reduce the font size or table width in Interactive report?
    Thanks
    Edited by: Sara254 on Jul 9, 2012 11:29 PM
    Edited by: Sara254 on Jul 9, 2012 11:30 PM

    Hi,
    you can do this in your style sheet.
    Look for class .apexir_worksheet_data and change the font-size.

Maybe you are looking for