• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: InDesign text frame baseline shift
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: InDesign text frame baseline shift


  • Subject: Re: InDesign text frame baseline shift
  • From: David Wolfe <email@hidden>
  • Date: Mon, 8 May 2006 16:12:12 -0400

Michel,

You might want to check the ruler origin in your document. This can be different from document to document, and would definitely cause the error you describe if it were off. You can double-click the upper- left corner where the two rulers meet to reset it to 0,0. You could also put a check into your script. I recently needed the same, because one of our typesetters always drags the ruler origin around the page to measure things and forgets to set it back to the top left. Here's the code I used:

	-- Setting Ruler Origin to Page instead of Spread
	set theOrigin to ruler origin of view preferences of active document
	if theOrigin is not page origin then
		set ruler origin of view preferences of active document to page origin
	end if

	--Set Zero Point of Ruler to Zero (top-left trim of page)
	set theRuler to zero point of active document
	if theRuler is not {0, 0} then
		set zero point of active document to {0, 0}
	end if

Hope this might help.
David Wolfe
settingPace

On May 8, 2006, at 3:40 PM, Michel Raj wrote:

Thank's Stan,
Your script works, it's just what I wanted.
But my script works well in a test page, and not in my layout, giving me a message saying that doing so would move objects out of the "plan de travail", the working area.
It says so, even if I reduce the geometric bounds values ???


Michel

Le 08-mai-06, à 21:20, Stan Cleveland a écrit :

On 5/7/06 12:20 PM, Michel Raj wrote:

I am trying to do the following :
Replace a selection of text by an anchored text box which would have a
baseline shift of 8.


At the moment, I have the following, which is ok, but I cannot give the
text frame "myTF" the desired baseline shift.


tell application "InDesign CS"
activate
delete selection
set myTF to make text frame with properties {geometric bounds:{3, 60,
0, 0}} at selection
set point size of text of myTF to 6
set contents of myTF to "some text"
end tell


Any cue ?

Also, how do I apply a paragraph or character style to a text ?

There are probably other ways to do what I want, but I asked myself how
to do it in AS... so I am trying...

Here is your code with modifications to do what you are asking:

tell application "InDesign CS"
    activate
    delete selection
    set myTF to make text frame with properties ¬
        {geometric bounds:{3, 60, 0, 0}} at selection
    set point size of text of myTF to 6
    set contents of myTF to "some text"
    -- apply character and paragraph styles
    set applied character style of text of myTF to "Special Italic"
    set applied paragraph style of text of myTF to "Section Header"
    -- define myTF as text object and adjust it
    set refTF to parent of object reference of myTF
    tell refTF
        set baseline shift to 8.0
        set justification to center align
    end tell
end tell

The variable refTF is a reference to the anchored text frame as a text
object. OMM it is:
text from character 1 to character 1 of story id 137
of document "Test.indd" of application "InDesign CS"


Note that there are very few text properties that can be applied to an
anchored text frame. While I know that baseline shift and justification
work, I leave it to you to determine exactly which other commands do.


Stan Cleveland
Color Technology Inc.
Portland, Oregon



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (Applescript- email@hidden)
Help/Unsubscribe/Update your Subscription:
40settingpace.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Re: InDesign text frame baseline shift (From: Stan Cleveland <email@hidden>)
 >Re: InDesign text frame baseline shift (From: Michel Raj <email@hidden>)

  • Prev by Date: Re: InDesign text frame baseline shift
  • Next by Date: Re: InDesign text frame baseline shift
  • Previous by thread: Re: InDesign text frame baseline shift
  • Next by thread: Re: InDesign text frame baseline shift
  • Index(es):
    • Date
    • Thread