Article View: adobe.scripting.indesign
Article #14701Re: [AS] rule above footnotes
From: martin_josef_fischer
Date: Wed, 21 Jan 2004 22:07
Date: Wed, 21 Jan 2004 22:07
41 lines
2450 bytes
2450 bytes
Hello Shane,
this is great!
Thank you very much!
You know, I am a newbee writing applescripts.
But now I have got excited: I will write applescripts 26 hours a day. ;-)
I have tested your script and have made a few corrections:
1. There are some pages without footnotes. So I included "try ... end try".
2. The document is doublesided and has a left and a right page. So I had to get the x1-coordinate of the footnote-frame of the left page and the right page (which are different).
3. The first character of the footnotes is the number (which is superscript). Sometimes there was a pagebreak in a footnote and so the first character of the footnote-frame on the next page wasn't superscript. So I had to get the baseline position of a non-superscript character (here: the seventh character).
Here is my final script:
tell application "InDesign CS"
set ruleDist to -4
set ruleLength to 18
set ruleThick to 0.5
tell document 1
-- get doc details
tell document preferences
set pageCount to pages per document
end tell
-- loop through pages
repeat with i from 1 to pageCount
-- get position of seventh character of the frame
-- may be there is no footnote at the page
try
tell (text frame 1 of page i whose vertical justification of text frame preferences = bottom align)
-- hope, the seventh character isn't superscript
set theBase to baseline of character 7
-- x-coordinate of the footnote frame
set x1 to (item 2 of geometric bounds)
end tell
end try
-- make rule
make graphic line at page i with properties {geometric bounds:{theBase + ruleDist, x1, theBase + ruleDist, x1 + ruleLength}, stroke weight:ruleThick}
end repeat
end tell
end tell
Technical Details
Message-ID:
<2ccf7c2d.1@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webxReferences:
<2ccf7c2d.-1@webx.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,2c9a5b6d1905654e X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2004-01-21 14:08:14 PST From: martin_josef_fischer@adobeforums.com Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: Re: [AS] rule above footnotes Message-ID: <2ccf7c2d.1@webx.la2eafNXanI> Date: Wed, 21 Jan 2004 14:07:36 -0800 References: <2ccf7c2d.-1@webx.la2eafNXanI> Lines: 52 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit