Bypass: Part 1

This post is for those that may be interested in the events of the last couple of weeks. Thank you very much for all of the prayers, love, and words of encouragement. I thank God for such good friends and an amazing family.

A little background: I am 53 years old and have been fairly active over my lifetime. I was an avid cyclist in my late teens and early twenties. Over the years, I have struggled a bit with my weight, fluctuating from my wedding day weight of 155 (in 1984) to 198 when my 8th son was born (in 2002). Shortly after I hit my high, I lost 40 pounds and eventually settled in the low 160s (I am 5′ 6″).

In early 2010, I bought a nice bicycle and started riding again. I really enjoy aerobic exercise and there are some great roads here in Orleans County (New York). My main riding partner is my 14-year-old son Jason. That first year, I rode 2,300 miles on the bike and finished with a 108 mile ride the length of NYS Route 19. I hadn’t been in such good shape in over 25 years. The next year, I rode 1,900 miles on the bike.

I have struggled to maintain fitness during the winters. You stop riding, but the cycling appetite doesn’t stop right away, so it’s easy to keep eating. This past winter my weight crept up to a high of 188. But we had big plans for 2012: I was to help lead a bunch of young men on a 380 mile ride across NYS along the Erie Canal. We had a great spring here, so by June 14, two days before the trip, I had 794 miles on the bike and had cut back to 176 lbs.

A week or so before the trip, things got a bit interesting. In spite of being in good cycling shape, I started having some lousy rides where I just didn’t feel right. To put things in perspective, here is an entry from my cycling log, one month previous:

5/17/2012 39 miles. Rode with Jason and Jonathan to Batavia library and back. Had a 16.1 mph pace to beat the darkness. Ate up the hills on NY 98. Felt terrific. Rated 9/10.

I was still having rides like this in early June:

6/6/2012 6:30 PM 23 miles. Rode solo to church via Barre, Clarendon, and Byron. Beautiful ride on a beautiful evening. Saw a nice rainbow.

Look at the contrast just 3 days later:

6/9/2012 8:26 PM 16 miles. Rode with Timothy to Albion then to Morriseys. Met Bill’s sister Joan. Suffered through the whole ride chasing Timothy. If all rides were like this, I wouldn’t be a cyclist.

6/11/2012 8:53 PM 16 miles. Rode with Jason west on 31 to Phipps Road to Eagle Harbor to 31 to Allen Road. Then rode around Albion and back home via Butts Road and 31. Felt lousy with tightness in chest for much of the way.

By now, I am sure you can see the warning signs for some real problems. I told my wife Sherry how I was feeling on the bike and she scheduled an appointment with my primary care physician for Wednesday. I had a normal EKG so she scheduled me for a stress-test on Friday, the day before the trip. I really wanted to go on the trip, so I wanted a least one more ride to see if the others were a fluke. Here is my log entry for my last ride that Thursday evening:

6/14/2012 8:00 PM 21 miles. Rode from Bike Zone with Joe Lodice and Jason. Felt lousy with chest discomfort and fatigue. Probably the worse ride of the year. I am going for my stress test tomorrow :-(.

Sure enough, the stress test on Friday showed an 80% chance of blockage in at least one of my coronary arteries. So I was officially grounded. But thankfully, my two sons and the rest of the group successfully finished the ride on Saturday, June 23rd. (If you are interested in learning about the trip, take a look at bike300.wordpress.com.)

Lord willing, I am going to add one or two more posts regarding what happened next. But I want to finish this post with a bit of advice. The cardiologist told me that had I been sedentary, this problem may not have surfaced for 10 or more years, and that I may have just dropped dead from a heart attack. It was the aerobic exercise that manifested the problem early. If you are mainly sedentary or don’t often stress your heart during exercise, I would strongly suggest that you have a stress test. It was really not bad at all as far as the process and it is apparently a good diagnostic tool.

Let me say it one more time. Perhaps your weight is under control, your cholesterol is good (like mine is), and you “work out” or exercise regularly. But if your heart-rate is never elevated for sustained periods of time, a heart problem may not show up. Get a stress test.

Using a regular expression to convert an image name to a path

Mike and I started an interesting discussion about using ExtendScript to import images from a base file name that the user enters. One of the key tasks is to figure out how to take a base file name that uses their syntax and derive a full path from it. Based on Mike’s examples, I came up with the following ExtendScript function:

This function illustrates the power of regular expressions. The basic regular expression is this:

Find 3 uppercase letters: [A-Z]{3}

followed by four digits: \d\d\d\d

The parentheses “capture” parts of the match and put them into special variables in the form of $#, where # is a number from 1 to 9. To figure out what number goes with what set of parentheses, you start counting from the left. So, in our regular expression

([A-Z]{3}) will be $1. In our example, this will be MSP.

((\d)\d) will be $2. In our example, this will be 43.

(\d) nested in $2 will be $3. In our example, this will be 4.

and (\d\d) will be $4. In our example, this will be 21.

We can use these variables to build up our path. Notice the $# variables in the replacement string (color-coded for clarity):

This will become

The backslash in JavaScript is an escape character, so to get the literal backslash character, we have to use 2 where we want 1.

Copy the function into the ExtendScript Toolkit and try a few filenames that use this format, and you will get the correct path every time. Regular expressions are a deep topic, but as you can see, they are very powerful for parsing tasks like this.

-Rick

FrameMaker 10 ExtendScript: The Object Model

Thank you to all that attended this webinar. I will post the link to the recording as soon as it is available. In the meantime, here is a link to the FrameMaker Object Model chm file and webinar slides:

http://www.rickquatro.com/resources/FM10_ObjectReference.zip

Here is a link to the FrameMaker 10 FDK:

http://www.adobe.com/devnet/framemaker.html

After you install it, the documentation will be in the docs folder.

Arnis asked about dumping a list of properties for an object. In FrameScript it is easy:

With ExtendScript, you can use a function; in this case, I am writing to the JavaScript Console instead of the FrameMaker Console:

Please let me know if you have suggestions for future webinars. Thanks again for all your support.

-Rick

ExtendScript Webinars: What Do You Want to Learn?

I just finished my second FrameMaker 10 ExtendScript webinar, which I enjoyed immensely. The first one was done in conjunction with Adobe, the second was sponsored by Carmen Publishing Inc. I would like to do more ExtendScript webinars and want to know what topics people are interested in. Please leave comments with suggestions for ExtendScript topics. Thank you very much.

-Rick

In Memory of Bruce Foster

Bruce Foster, creator of many fine FrameMaker plugins, passed away suddenly on Saturday, June 11, 2011. Although Bruce had been diagnosed with multiple myeloma in September 2010, his death still came earlier than was expected. Bruce’s plugins for FrameMaker were BookInfo, ImpGraph, MifSave, MifToFM, RtfSave, and his most famous, Archive.

Bruce’s website is now offline and, as far as I know, his plugins are no longer available  for sale.

Adobe Engineering has just released a free ExtendScript script for archiving FrameMaker 10 books:

http://blogs.adobe.com/techcomm/2011/07/create-a-book-packager-using-extendscript.html

I haven’t tested the script yet, so I can’t necessarily recommend it, but it is certainly worth looking at.

– Rick

FrameMaker 10 and ExtendScript Automation Slides and Samples

Last week’s FrameMaker 10 and ExtendScript Automation eSeminar went well in spite of a few glitches. Thank you to Adobe and Tom Aldous for graciously hosting and promoting the seminar. Thank you especially to all that attended and submitted questions.

As promised, we are making the slides and sample scripts available for download. You can download the slides from:

http://www.rickquatro.com/resources/ExtendScriptSeminar.pdf

The samples are at:

http://www.rickquatro.com/resources/SampleScripts.zip

The sample scripts may not meet your current requirements, but there are portions of each script that you can reuse in your own scripts. You can also use them to learn good scripting practices and how to approach similar problems. In future posts, we will dissect one of the scripts so you can learn solid techniques for writing your own.

Here is a link to the eSeminar recording:

https://www.adobe.com/cfusion/event/index.cfm?event=register%5Fno%5Fsession&loc=en%5Fus&id=1808717

-Rick

Autonumber Problems

Here is part of a recent post on the Framers list:

Single-file doc with four Sections. Sections and sub-sections numbered 1, 1.1, 1.1.1 etc.

Pgf numbering formats:

Heading1 S:<n+>.< =0>< =0>< =0>
Heading2 S:<n>.<n+>< =0>< =0>
Heading3 S:<n>.<n>.<n+>< =0>

But I’m getting Sections 1 and 2 (with subsections), then 5 and 6 (which should be 3 and 4)….Pix and tables are numbered with F:<n+> and T:<n+> respectively so shouldn’t be affecting anything.

Autonumbering in FrameMaker is one feature that is rock-solid. So these problems are always caused by intervening paragraphs that have unintended autonumber counters. The trick is finding the offending paragraphs. I use a FrameScript script to make an “autonumber report” of a document or book. With this report, the cause of autonumber problems can be quickly found.

The author of the Framers post sent me the problem document and in seconds I generated the following spreadsheet (click the image to see it full size):

It’s pretty easy to see the problem paragraphs, which I have highlighted. The key to finding them is to look for the last good number, which is in row 13. Next, look for the first bad number, which is in row 20. Now we know that the problem paragraph or paragraphs is between these two rows in the spreadsheet. At this point, it’s best to scan the Autonumber String column, and look for the S: series label, which brings us to rows 15 and 17.

As it turns out, in this document the two offending paragraphs were very small and at the top of the page, which is why they were difficult to find. But like many other tasks, FrameScript makes it easy. If you are interested in purchasing this script, please let me know. Thank you very much.

– Rick

Lining up a Table Across Columns

This question comes up from time-to-time on the FrameMaker lists, so I will illustrate the problem and solution with four screenshots. You have a single table anchored in a paragraph in the left column. As the table flows from column-to-column, the top of the table in the first column does not line up with the top of the table in the rest of the columns.

To remedy this, you need to change settings in two dialog boxes. First, click in the anchor paragraph and bring up the Paragraph Designer. Change the Line Spacing to 0 points and the Space below to -2 points and click Update All. Go to the Default Font area of the Paragraph Designer, set the Font Size to 2 points, and click Update All (not shown in the screenshot). You won’t see a change until you do the next step.

Click in the table and open the Table Designer. Change the Space Above to -2 points and click Update All.

The table tops in all of the columns will now line up with each other.

Setting Acrobat Bookmarks for a Book

When you save a FrameMaker book to PDF, you are presented with the PDF Setup dialog box, where you can set which paragraphs (or elements) you want to appear as bookmarks in the PDF. Often, you will set the Include formats and levels just how you want them, but when you make the PDF, one or more paragraphs will be included that you didn’t specify. In fact, these paragraphs won’t show up in the Include/Don’t Include lists in the PDF Setup dialog box. Scott Prentice, in a recent framemaker-dita@yahoogroups.com post, gives the reason behind this:

In my testing, I believe that the key factors are that the first file in the book needs to have definitions for all of the para styles in the book, and you have to set the include/exclude values on that file. If it’s a binary file, these settings would be made there … if it’s structured, you’d need to make those settings in the template that’s applied to that component. Continue reading “Setting Acrobat Bookmarks for a Book”

Fun with Acrobat Forms

I have created a great workflow for developing Acrobat forms, using FrameMaker, FrameScript, and TimeSavers from MicroType (http://www.microtype.com). Using this workflow makes it practical to use FrameMaker to develop PDF forms. FrameMaker’s graphic and table features can be used to layout great looking forms, while TimeSavers eliminates nearly all of the required Acrobat post-processing. A set of FrameScript scripts streamlines the insertion of the TimeSavers markers in the FrameMaker documents.

If you have a need for Acrobat forms, or are interested in the process, please let me know. I will be glad to provide a demonstration of the process. Also, I am soliciting a few more forms to do for free that I can use for demonstration purposes. If you have a forms that you would like converted to Acrobat forms, please let me know. In the meantime, take a look at some of the forms I have developed using FrameMaker, FrameScript, and TimeSavers:

http://www.rickquatro.com/forms/ClientQuestionnaire.pdf
http://www.rickquatro.com/forms/LosersAreWinners_Men2.pdf
http://www.rickquatro.com/forms/LosersAreWinners_Women2.pdf

-Rick