[AS CS3] Another MathType Baseline Shift Question

Hi Guys,
I am using the below script to place MathType Equations into an InDesign File
Basically it searches for tags <<Filename.eps>> and replaces it with a inline graphic.
My question is:
Is there anyway I can get it to read the height of the InLine Graphic Box and then get it to baseline shift so it's centered height wise on the line, instead of the set amount of -10pt that is uses now?
We have to open the MathType Equations in Illustrator to change font and colour to Pantone etc, so they are save back as Illustrator EPS's
Below is the Script:
tell application "Adobe InDesign CS3"
tell document 1
set baselineVar to "Yes"
set countVar to 0
set imageCount to 0
set docPath to file path as alias
tell application "Finder"
set imageFolder to folder (choose folder with prompt "Please choose the folder containing the appropriate MathType files") --"MathType" of artFolder
end tell
activate
set allStories to stories
repeat with s from 1 to count of items of allStories
set theStory to item s of allStories
if class of theStory is story then
set theLim to count of words of theStory
try
repeat with i from 1 to theLim
if word i of theStory contains "<<" then
set theText to contents of word i of theStory as Unicode text
set theOffset to (offset of "<<" in theText)
set endOffset to (offset of ">>" in theText)
set imageName to characters (theOffset + 2) through (endOffset - 1) of theText as string
set imageFolderPath to ((imageFolder as string) & imageName)
set wholeTag to characters theOffset through (endOffset + 1) of theText as string
if baselineVar = "Yes" then
set baseline shift of characters theOffset through (endOffset + 1) of word i of theStory to -10.2
end if
delete characters theOffset through (endOffset) of word i of theStory
tell theStory
tell word i
tell character theOffset
place imageFolderPath as alias
set countVar to (countVar + 1)
end tell
end tell
end tell
end if
end repeat
end try
end if
end repeat
end tell
activate
if countVar = 0 then
display dialog "No Images were found" buttons "OK" default button 1 with icon 2
else if countVar = 1 then
display dialog "1 lonely Images has been placed." buttons "OK" default button 1
else
display dialog (countVar as string) & " Images have been placed." buttons "OK" default button 1
end if
end tell
Thanks
Marcus

The place command will return a list containing a reference to the placed<br />image. You can then get the bounds of its parent, compare them with the<br />baseline, and change them accordingly.<br /><br />-- <br />Shane Stanley <[email protected]><br />AppleScript Pro Florida, April 2009 <a href=http://scriptingmatters.com/aspro>

Similar Messages

  • How to fix faux subscripts/superscripts made with baseline shifts

    Hello all.
    There is a script on the forums used to convert locally formatted styles to character styles – Preserve Local Formatting script and CS4
    It is a brilliant script, but as I have unexpectedly found out (and would have found out if I read the post in more detail) is that any "faked" sub/superscripts created with baseline shifts won't work. To quote the other thread:
    The script searches for attributes such as "superscript", "subscript", "small capitals". If small caps are faked in the document with capitals in a smaller font, the script will not find them. If superscript or subscript are faked in the document with a smaller font size and some baseline shift, the script will not find them.
    Initially I didn't think this would ever be a problem... I thought "who the hell would make a subscript or superscript like that? wouldn't they just click the subscript or superscript buttons?"... unfortunately, no!
    I thought a solution would be to make a GREP that could be added to a findchangebylist script that ships with InDesign. First thing to do would be to create a GREP to look for any positive baseline shift and change it to superscript; and a GREP to search for any negative baseline shift and change it to a subscript. Sounds simple... until I tried to implement it, as the dialog won't take a + or - by itself... it has to be a proper value.
    Has anyone else faced this issue, and if so, what was the solution/outcome?
    Colin

    @Rob: Perhaps I should have given some background for what I was trying to do.
    I have a client who is importing dozens of pages of simple chemical equations from microsoft word and it is in the word file that the baseline shift method of creating subs/supers was done. What my client wanted to do was import the text without losing important appearance details such as this, and bolds/italics, but then be able to assign his own paragraph styles without faux sub/supers returning to a regular style. My procedure to the client was to:
    Import said word file into indesign file that contains appropriate paragraph/character styles to be applied;
    Run the default "findchangebylist.jsx" to remove any double spaces, tabs etc.
    Run a modification of Jongware's "preptext" script that will apply to all text frames rather than the current text frame.
    This was working well until we both noticed H2SO4 did not have the numbers as subs, even though the word file clearly did. Closer inspection on the word file showed that the subscript button was not toggled, but the baseline shift had been, hence why the preptext script had missed a key piece of formatting.
    With the preptext script, items that had subscript and superscript locally applied to the text would now be assigned "Sub" and "Super" character styles, and from there I agree - the more discerning typesetter could to into the character style and make the apperance of the said subs/supers more appealing. I believe a way of using the opentype subs/supers would be to replace the words SUBSCRIPT and SUPERSCRIPT in the said script to be OT_SUBSCRIPT or OT_SUPERSCRIPT respectively, provided an opentype font was being used for the formatting.
    So in this instance, this script serves a rather specific purpose of fixing this particular document, rather than being applicable on a wider scale.
    It is also important for anyone working with epubs to note that subs/supers made with baseline shifts (whether applied as character styles or not) will not appear in the resulting epub. Subs/supers made with the subscript/superscript buttons (again, whether applied as a character style or not) will appear in a resulting epub, so this is another consideration (I don't know if this is true if a customised CSS has been applied, but for straight export to epub from InDesign, it appears to be the case). This can be said for other forms of faux styles, such as skewing type to make a faux italic.
    @Peter: I agree, there isn't a perfect solution, but for the situation that I have, the script does what it is intended to do.
    It should be noted for readers of this post that this script is specifically purpose-driven, and that I would not use this script if a document contained:
    fractions made using baseline shifts;
    character or paragraph formatting that used baseline shifts;

  • Another Unlimited Data Upgrade Question

    (Yes, it's another one of those questions.  I'm sorry, but searching - on here, or on Google - only left me with conflicting information.)
    Here's my question:
    A friend of mine is interested in selling me his Galaxy Nexus phone.  Would I be able to keep my single-line, grandfathered, unlimited data plan if I buy his phone and switch to it, or is that only possible if I were to buy the phone new, directly from Verizon?
    Here's my story:
    I have an HTC Thunderbolt that I purchased when it launched.  A few months after buying it, it turned into the HTC Bad Dream, and now it's the HTC Nightmare.  Random heat issues, battery draining, random reboots... It's the same song and dance we've heard before.  These are design issues with the phone; not something a replacement or a repair would fix.
    The real annoyance, though, is the mobile hotspot.  I pay $30/month to use the hotspot legitimately, unlike the users who root their phones to use it without paying for the option, but ever since Verizon started blocking the third-party wireless tethering apps, I've had to choose between using the stock mobile hotspot app and unleashing the above-mentioned Phonemageddon, or simply going without.  I could drop the option from my plan, but seeing as the unlimited data plan no longer exists, I wouldn't be able to get it back without switching to a tiered or shared plan.
    Switching to a more stable phone would alleviate my issues, hopefully, but the difference between Verizon's retail prices and other retailers is hundreds of dollars.  Giving up my unlimited plan, however, wouldn't make the venture worth it.  A definite answer to the question of buying used - either from a Verizon representative, or a customer who's been in the same scenario before - would be very helpful.
    Thank you very much.

    Hi,
    If you provide your own equipment (your friend's Nexus or from ebay etc) then YES you can keep unlimited data. Another wayto keep unlimited would be to pay full retail for a new phone. But I'm sure your friend will give you a better deal than that
    Hope that helps!

  • Is the ability to center an inline object with a baseline shift gone in Pages 5.0?

    In the previous versions of pages I was able to center an inline object such as an imported equation with a baseline shift. I cannot find this in pages 5.0.
    It is gone?

    select line > Format > Style > Stroke > click on the color wheel next to the swatch > select a color
    Peter

  • Photoshop CS5 - changes in "baseline shift"

    When opening old Photoshop CS2 projects in Photoshop CS5, everything looks as it did before.  But for about 75% of the text, the "baseline shift" field now has a value other than zero.  It seems like I will need to set my "baseline shift" of the affected text back to zero then reposition the text.  I would just prefer the "baseline shift" to be set to zero, as I am know I did not adjust this value.
    Is it possible that the "baseline shift" value is something other than zero for certain fonts and I just never noticed that the value was not zero before?  Or is this an issue of opening a CS2 Photoshop project in CS5?
    Thanks,
    Angela

    Hunt,
    I did some more investigating.  First, can you let me know in Photoshop CS2 if the "baseline shift" value is automatically set to zero when inserting text?  Or, if some fonts have the "baseline shift" automatically set to zero while others are automatically set to a non-zero value?
    For my issue, it looks like the value of the baseline shift is directly related to the resolution of the project.  For both TTF and OTF fonts, the following was found:
    1. For projects with resolution of 72 pixels/inch (my DVD menus which have D1/DV NTSC aspect ratio setting), text has a baseline shift of -3.27pt
    2. For projects with resolution of 150 pixesl/inch (my CD and DVD labels), text has a baseline shift of -8.33pt
    3. For projects with resolution of 500 pixels/inch (my DVD cases), text has a baseline shift of -2.5pt
    The only exception is the text created on a circular path.  The baseline shift of this text was always zero.
    Is this works-as-designed and something I just did not notice before?  Or is this something that happened as a result of opening a CS2 Photoshop project in CS5?
    Thanks so much,
    Angela

  • Rtf baseline shift control

    I have setup a specific baseline in a form text field with placeholder text. It seems that the richt text data is linked to the text because when I erase all text and write something new the baseline shift is reset to 0.
    What are my possibilities, I need a baseline shift all times, can I run a script that enables a certain baseline shift on all my fields?
    I use rich text format.
    thanks

    Are you usually using a pc? Holding down the control key on a mac and clicking pops up the right-click menu in all software, it's a system wide convention (and a relic from the days Apple insisted that users should only be using a single mouse button).
    To get the result you are probably looking for, i.e., overrriding a master page item, hold down *Command* and shift on the Mac.

  • Baseline Shift Missing?

    Hi,
    I'm using Illustrator CS5 on Mac OS X 6.6 but can't seem to find the option to move certain text up or down. I tried the leading with no response so I tried looking for the baseline shift but can't find it in Illustrator. I keep summoning the character panel but still no option for it. I tried copy and paste text from InDesign but it keeps creating outlines. Does Illustrator not have a baseline shift property?

    Use the flyout menu (small triangle, upper right of the Character panel) and choose Show Options. 4 more windows will appear, one of which is the baseline shift.

  • Why do my text boxes keep defaulting to .3 pt raised? Baseline shift

    Every time I make a new text box, it defaults to BASELINE SHIFT .3 pt
    WHY?
    http://www.ccwatershed.org/media/photologue/photos/464_3_point.jpg

    That's how someone set the defaults. Change them with nothing selected.
    Bob

  • IndCS3 Trademark Symbol baseline shift

    Hi
    I have inserted "Alt2" the TM symbol into my headings which use font size 48, I have manually changed the TM to font size 14 and forced the baseline shift for the TM to 14, so that it sits level with lowercase text in the heading.
    I have created a para style for my headings but because of the different font sizes and baseline shift within the heading, it always shows as an applied stle with an override. So if I alt click on the style it then forces the TM back to font 48 etc.
    I dont want to manually reconfigure this for every heading.
    Is there a way of setting multiple font sizes and baseline shift within a character/para style or is there something better suited?
    thanks
    Sue

    It's not clear to me whether you're using a trademark glyph (what you
    get with ALT 2) or just a capital T and M formatted to look like a
    trademark glyph. All by itself, the TM glyph sits off the baseline and
    smaller (like a superscript), so I don't understand how baseline
    shifting it 14 pts is going to put it level with text. Baseline shifting
    it up is just going to move it even higher off the baseline. Maybe
    you're baseline shifting it *down* 14 pts? Maybe you're saying 14 pts
    brings the TM baseline up to the top of the heading x height?
    That said, if you're using the trademark glyph, but you want it to be
    formatted differently than the typeface gives it to you, you should make
    a character style that gives you your preferred formatting and apply it
    to each one of these. Then when you ALT-apply the paragraph style or
    right-click Clear Overrides, you won't lose the local formatting. This
    is the basic relationship of character styles to paragraph styles.
    Paragraph styles are for formatting the paragraph. Character styles are
    for formatting individual characters differently from the rest of the
    paragraph.
    Then you can search for the TM glyph and replace it with the character
    style you made. If they show up in different places but you only want to
    apply it to the ones in headings, include the heading paragraph style in
    the search.
    Kenneth Benson
    Pegasus Type, Inc.
    www.pegtype.com

  • Baseline Shift?

    Is it possible to apply a baseline shift? I am trying to reduce a registered trademark and a rather large headline and need to bump the baseline of the mark up so it aligns properly.

    Hi,
    Baseline shift as a character-level text attribute is not yet supported.
    You can only shift inline page items (e.g., images pasted inside text frames) relative to the baseline by moving them with the mouse, nudging them with arrow keys, or using the "Y" transform controls.
    Abhishek

  • Another "get album artwork" question

    another "get album artwork" question
    I notice that when I click "get album artwork" it seems to go through the whole library and look for cover jpegs. (in my case, that's going to take a long time!)
    here's my question: it's looking for artwork, yes, but it's NOT going to do anyything to the many, many albums for which I have already (manually) added artwork, is it? If it does - I am in trouble! Please, somebody, reassure me that the artwork I have painstakingly added manually to zillions of albums is safe!
    w

    Updade...
    So, as another test, I uninstalled iTunes, then checked the hard drive again.
    All the icons have now turned into Quicktime icons, which leads me to believe that when you look at your music in finder, it shows the icons related to your default music player.
    So, my next step is to find a new default player, and maybe my album covers will show up again.

  • Interactive form in Japanese language - baseline shift problem

    Dear All,
    I have a big problem with interactive forms. I developed a PO form for a Japanese company in English. When I transate it and use Kanji characters in the translation the baseline of these characters is about one line below where they should be. I use Arial fonts at the form development and the ADS changes it to MS Mincho or MSP Gothic. These two character set was also installed to the ADS font directory. Is it possible to use one form for the English and Japanese version of the form or I have to develop another form to the Japanese form and set the baseline of all the characters? Does anybody have experience in this issue? Has anybody developed PDF-based form in Japanese language?
    BR,
    Peter
    Moderator Message: Pleae post your questions in the right forum. In this case: .
    Edited by: kishan P on Nov 8, 2010 9:42 AM

    Yes I did.
    I have written the code as given below. It is not working either. Can you please check my code.
    DATA:
          FM_NAME TYPE RS38L_FNAM,
          FP_DOCPARAMS      TYPE SFPDOCPARAMS,
          FP_OUTPUTPARAMS   TYPE SFPOUTPUTPARAMS.
    fp_outputparams-nodialog = 'X'.
    fp_outputparams-getpdf = 'X'.
    CALL FUNCTION 'FP_JOB_OPEN'
    CHANGING
    ie_outputparams = fp_outputparams
    EXCEPTIONS
    cancel = 1
    usage_error = 2
    system_error = 3
    internal_error = 4
    OTHERS = 5.
    Get the name of the generated function module
    CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
    EXPORTING
    i_name = 'ZHR_APPT'
    IMPORTING
    e_funcname = fm_name.
    Set form language and country (->form locale)
    fp_docparams-langu = 'E'.
    fp_docparams-country = 'US'.
    fp_docparams-fillable = 'X'.
    call the generated function module
    CALL FUNCTION FM_NAME
        EXPORTING
          /1BCDWB/DOCPARAMS        = FP_DOCPARAMS
          T_HR                     = wa_emphr1
       IMPORTING
        /1BCDWB/FORMOUTPUT       =
        EXCEPTIONS
          USAGE_ERROR           = 1
          SYSTEM_ERROR          = 2
          INTERNAL_ERROR           = 3.
    Thx,
    John

  • Form translation to Japanese - baseline shift

    Dear All,
    I have a big problem with interactive forms. I developed a PO form for a Japanese company in English. When I transate it and use Kanji characters in the translation the baseline of these characters is about one line below where they should be. I use Arial fonts at the form development and the ADS changes it to MS Mincho or MSP Gothic. These two character set was also installed to the ADS font directory. Is it possible to use one form for the English and Japanese version of the form or I have to develop another form to the Japanese form and set the baseline of all the characters? Does anybody have experience in this issue? Has anybody developed PDF-based form in Japanese language?
    BR,
    Peter

    Hi Peter,
    I faced exactly the same while adapting the standard PO-form.
    Here's the solution:
    If you copied the standard PO-form you'll probably find the following tag in your form's XML:
    <?originalXFAVersion http://www.xfa.org/schema/xfa-template/2.1/?>
    You should replace it by
    <?originalXFAVersion http://www.xfa.org/schema/xfa-template/2.2/?>
    Alternatively you can also check the compytibility settings in Lifecycle designer:
    Menu "Edit/Form properties" switch to tab Compatibility:
    Update textformatting and event model to the recommended version using the two buttons there.
    This should actually do the job.
    regards

  • Another simple classpath problem question

    Hi All
    Yes I know, there are a lots of questions about this matter, but I couldn't found a solution to my problem.
    I have a simple program:
    public class prueba {
            public static void main(String[] args) {
                    System.out.println("Ahi va...");
    }placed in /tmp/javier/prueba.java
    After compiled, I've tried to run it from / and then problems started:
    cd /
    java /tmp/javier/prueba
    Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
    I said, ok...it could be a classpath problem...then:
    java -cp /tmp/javier/ /tmp/javier/prueba
    Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba
    Damn, another try...
    java -cp .:/tmp/javier/ /tmp/javier/prueba
    Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
    Jesus Christ....may be the last slash....
    java -cp .:/tmp/javier /tmp/javier/prueba
    Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
    Oh...no.... may be classpath to java classes..
    java -cp .:/usr/java/j2sdk1.4.2_01/lib/jre/:/tmp/javier/ /tmp/javier/prueba
    Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
    Well, I don't know why this error happens....
    Please, could somebody help me !!!
    Thanks in advance...
    <jl>

    It's not too early to start following the Sun coding
    conventions for Java:
    http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.
    tmlHi
    thanks for your reply.
    Yes, I agree. I use conventions with my programs. But my real problem was with a real application and then I did quickly this simple code to help others to understand the problem and give a fast reply...
    Let me know if that works. (It was fine on my
    machine.) - MODYes it works fine, thanks.... and Damn...Murphys law again, the only option I didn't tried is the solution to my problem... :)
    Thanks again...

  • Continuation of Field Shift Question

    This is a continuation of my previous question which was answered.  Using the rect property, I am able to move a field horizontally or vertically based on the value of a radio button (yes/no).  If Yes, I want to shift a specific field down.  If No, I keep the field in its original position.  The problem I am encountering is when a user toggles between Yes and No.  The specific fields are shifted down due to the radio button value being Yes and when the value is changed to No, the fields remain in the new position.  Is there a way to Setthe X,Y coordinates of a field using rect or rectangle?  Did some research but can't figure it out.
    Thanks

    Out of curiosity, instead of opening a new thread, should I have just replied to the original thread?
    The problem is when a user toggles through the Yes and No values on the radio button.  Ideally, the user would only select one or the other.  If so, my script using rect would move the fields down if yes is selected and keep the fields in their original position if no is selected.  However, if a user selects yes, then changes their selection to no, the fields will stay in the new position and not revert to the original position.
    I wanted to see if there was a way to actually set the rect properties to actual X,Y coordinate values so that when Yes is selected, the fields move to a specific position and when No is selected, the fields move to a specific position.  I am using part of a script I found in the reference guides and my lack of knowledge of this script property is leading to my confusion.
    The code I'm using is:
    var a = this.getField("costs");
    var aRect = a.rect;
    if (this.getField("radiobutton").value == "Yes") {
    a.display = display.visible;
    aRect[0] -= 0; // increment first x-coordinate by 10
    aRect[1] -= 100; // increment first y-coordinate by 20
    aRect[2] -= 0; // increment second x-coordinate by 10
    aRect[3] -= 100; // increment second y-coordinate by 20
    a.rect = aRect; // update the value of b.rect
    } else {
    a.display = display.visible;
    aRect[0] += 0; // increment first x-coordinate by 10
    aRect[1] += 0; // increment first y-coordinate by 20
    aRect[2] += 0; // increment second x-coordinate by 10
    aRect[3] += 0; // increment second y-coordinate by 20
    a.rect = aRect; // update the value of b.rect
    By changing the "else" part of the script, I can have the field move up (+= 100) if No is selected after Yes.  The problem with adding that to the script is if a user selects No first, the field will move up.
    Additionally, I thought I could avoid a lot of the headache here by marking either Yes or No as the default value but my form also has a reset button and when the form is reset, the fields move either up or down depending on the last value.
    Is there a way to set the coordinates to specific values?  My script is using the fields current position to move accordingly.
    Thanks

Maybe you are looking for

  • Can't update iPhoto after mavericks update

    Hi, I recently updated my iMac with the mavericks OSX update - but now I cannot update iphoto. the app store shows that is knows an update is available, but whenever I try and update - the app store asks me for a password for my apple ID - but  nothi

  • Everytime I open itunes it says do you want to allow this program to make changes to your computer

    It opens but it's annoying as **** it never did it when I when I first bought it

  • Regarding CIN Excise Configuration

    Dear All, I have configured the excise part for domestic sales in my process. The cycle is running properly except when I try to make an excise invoice it is not taking values for the following fields: 1. ECess 2. HE Cess. Both the values are being r

  • Elements 9  editor won't close

    Help please. When I am in organizer on my Mac and I click on a picture to open it in Elements it says that the editor is busy and I need to exit before it will open the photo. What Have I done and what do I need to do? Thanks, Rob.

  • Tracert Same IP in multiple hops

    Hello all, Can you please help me to understand why i am gettign same IP repated in trace route:- tracert 103.1.191.10 Tracing route to 103.1.191.10 over a maximum of 30 hops   1    <1 ms    <1 ms    <1 ms  10.10.10.10   2    <1 ms    <1 ms    <1 ms