Welcome to

Sal's AppleScript Snippets

A site dedicated to AppleScripts and QuarkXPress


Last updated 5/27/97



Prisoner Number

History

Hello... my name is Sal Soghoian and I started scripting QuarkXPress years ago when there was even less documentation than the small amount available now. With the help of a few brave on-line souls such as Matthew Frederick, David Shaver, Marc Grabowski, Shane Stanley, Mike Arst, Jon Pugh, Phil and others, I managed to eek together enough scripting knowledge to learn how to script XPress. It required 13 hour days for a year and much head-banging but I learned the art. I then promised myself that others shouldn't have to endure what I went through to gain this valuable skill. That's when I created this site to spread the message and experience of myself and others.

Present
I'll be slowly constructing this site over time and ask for your patience. It will contain many useful and free scripts as well as PDF versions of the articles I write for X-Ray magazine and any useful links and freebies I can find.
 
Also... yes, it's true. I am now the AppleScript Product Manager for Apple Computer.
 
Speaking / Touring Schedule
Site Updating / What's New
 
There are numerous other updates coming shortly--so check back!
 
Clipboard to RTF OSAX (TEST VERSION 0.9.6) I commisioned the renown Donald Olson to write this OSAX (scripting addition) for me. It converts styled text on the clipboard into an RTF (Rich Text Format) file. Useful for getting styled text out of FileMaker Pro and into the Apple Media Tool or a variety of other uses.

It does have a few limitations: its doesn't support color or stylesheets. But I find it useful nonetheless.

 
Clipboard to HTML OSAX (TEST VERSION 0.6) Another OSAX frmom Donald Olson, this one will convert styled text on the clipboard to HTML! This means that the text from any FileMaker Pro database can be converted to HTML instantly. Optional parameters include:
  • You can choose the character to use in place of a bullet
  • You can choose wheter to use line breaks or paragraphs for return characters
  • THere is an option to have any underlined text treated as raw HTML--perfect for URLs!
 
Clipboard to XPress Tags OSAX (TEST VERSION 0.3) The one that everybody's wanted! Again, from OSAX master Donald Olson. It's here... an OSAX which will convert styled text on the clipboard to XPress Tags. It makes extracting styled text from FileMaker to QuarkXPress a breeze and comes with a sample FileMaker database already including the transfer script.
 
QuarkXPress to PhotoShop 4.0 Those of you who have upgraded to PhotoShop 4.0 will appreciate this script. Select the images in a QuarkXPress layout that you want to process in PhotoShop and run the script. Each image will be opened in PhotoShop and indicated scripts from the Actions palette will be applied to the opened image. Finally, you can easily manipulate the images used in a QuarkXPress document with PhotoShop! Comes with a illustrated read-me file.
 
Utility Scripts Page
A page of utility scripts for the computer and the Finder. A must-have for basic scripting.
 
AOL SCRIPTS!!! Yes, a page of AOL scripts that work with the new PPC 3.0 version for the Macintosh. Includes a special desktop applet that, when launched, will log onto AOL and go to any preset destination on AOL or the Internet!
 
Image - Contents to PICT File * A script for QuarkXPress that will save the contents of a selected picture box as a 72 DPI PICT image file.
 
AT&T Kern & Size Script 1.0 * A script for QuarkXPress that will search every story in a document and alter a certain text string. There is a matching PDF file describing the technique used in the script line-by-line. Featured in the latest copy of X-Ray Magazine!
 
PPrep - Make FPO Overlays * This is a bug fix for a script that ships with XPert Tools Vol. 2. There was a problem making the overlay boxes on the right-hand facing page. I forgot to set the item spread coords to true before getting the bounds of target boxes! The classic mistake many QXP scripters make--see, it can happen to anyone!
 
NEW!! How to: Database Publishing Lesson #1 * Much requested and finally here, this is the first lesson on how to create automated database publishing solutions yourself. This lesson is for anyone--even those new to AppleScript. The lesson is a step-by-step procedure for performing a mail merge between a FileMaker Pro database and a QuarkXPress document or template. Also included is an editable FaceSpan applet which will easily replace placeholder text in a QuarkXPress document with the contents of fields from any FileMaker database. This lesson is featured in the new X-Ray magazine.


Instructional Material - For beginners and others. (Saved in Adobe Acrobat PDF format). I'm trying to get some more disk space for this site so I can post more training material.
 
A link to the Adobe Forum to download the Acrobat Reader
 
Intoduction to AppleScript - (99K) Step #1 in the process of learning how to script QuarkXPress. This document talks about what AppleScript is and what system files are needed to make it work.
 
QuarkXPress Basics - (99K) Explains in easy-to-understand steps, how the QuarkXPress scripting structure is designed and works.
 
AppleScript basics - (644K) Explains some of the key AppleScript routines such as: dialogs, the Set command, and repeat loops. After completing these four documents, you're ready to write scripts for QuarkXPress!
 
Text and Picture Box Bounds - (132K) A 16 page instructional on working with the bounds property for text and picture boxes in QuarkXPress. You'll learn how to extract and manipulate the bounds in any measurement system. A MUST READ for QuarkXPress scripters!
 
Filters and Checks - (231K) Examples of how to check for certain items and document conditions. Included are checks for single picture, text, and line selection; picture boxes with or without images; picture boxes with certain kinds of images; whether text is selected; and others. Very useful.
 
How to: Database Publishing Lesson #1 * Much requested and finally here, this is the first lesson on how to create automated database publishing solutions yourself. This lesson is for anyone--even those new to AppleScript. The lesson is a step-by-step procedure for performing a mail merge between a FileMaker Pro database and a QuarkXPress document or template. Also included is an editable FaceSpan applet which will easily replace placeholder text in a QuarkXPress document with the contents of fields from any FileMaker database. This lesson is featured in the new X-Ray magazine.
 
IMPORTANT: A link to the new overview section I'm building on the AppleScript Website. It's going to be loaded with sample routines for the standard things scripters do everyday. For example: do you know how to have a user input only a DOS compatible file name in the new file dialog? --Go see for yourself!


Tools, OSAX, and Links

Download OSA Menu from a MIT archive

Download Jon's Commands from his page

A link to Street Logic's Homepage
I RECOMMEND THAT EVERY QUARKXPRESS SCRIPTER VISIT THIS PAGE! It contains information about and a demo version of the ScriptMaster XTension which makes QuarkXPress RECORDABLE! If you're intersted in learning how to script QuarkXPress, this is a great learning tool.

A link to Harold Shields pages. A fine scripter, Harold is adding value to the scripting community. ;-)


Scripts & Snippets (more to come soon)

GUTM 1.0b - (83K) A script suggested by and developed with Guy Kawasaki that processes mail from Claris Emailer using BBEdit 4.0. Copy your email into a BBEdit document and run this script. It removes most of the garbage, unwraps paragraphs with lines over 60 characters, stupifies quotes, and encases all URLs in "" and ">" marks.

Blimpie - (17K) My first game. Launch the script and Blimpie will ask yu to choose a number from 1 to 10. You get four guesses, otherwise Blimpie wins! He also keeps score. Entertaining but a good example of repeating dialogs with checks and a recursive routine (a sub-routine that calls itself). It uses the numerics OSAX to generate the random number.

Roll the Dice! - Wrote this script for those who like to gamble without losing money. It's a craps game and includes custom icons of the various dice combinations. Yes, your scripts can have custom icons! Download this one and open it with ResEdit to find out how.

QXP Process Droplet 2.0 - (17K) A useful shell for creating a batch processor for your QuarkXPress files. This script, when saved as a droplet, will process files or folders of files dragged onto it.

PBox * Drop Shadows - (17K) This script will create a shadow box underneath every picture box containing an image in a QuarkXPress document. Numerous lessons, especially for quickly extracting and altering the bounds of a box and for finding picture boxes with an image.

Briefcase - (116K) This is a script for managing fonts. We don't use Suitcase or Master Juggler here anymore. Place it in the Universal Scripts folder in the OSA menu and access it to enable or disable fonts. It works by moving the font suitcases in and out of the fonts folder. A little known fact: QuarkXPress WILL update font information on-the-fly regardless of what the system message says. Ah, INIT bliss!

Path to the Linked File - (17K) This script will prompt you to indicate the folder containing (or that will contain) the HTML page you're linking from. It will then prompt you for the file to link to. Both must be on the same drive.

The script will then extract and convert the file path you've indicated, to the slash format used in HTML coding, and place the results on the clipboard. The file path is shortened to show the heirarchal relationship between the folder containing the current HTML and the file to link.

For example, the file path:

Macintosh Hard Drive:A Folder:Folder Containing Current HTML:Folder Containing File to Link:The File to Link

becomes...

Folder Containing File to Link/The File to Link

If the file to link to is outside of the folder containing the page to link from, the script will calculate that and place the proper marks before the file path. Like...

../../Other Folder/Folder Containing File to Link/The File to Link

This script uses the "set the clipboard to" command from the Jon's Commands osax to copy the result to the clipboard. If you're using the script in QuarkXPress you can just copy the text in the variable to a text box instead.

Other Scripts

PhotoFlash Scripts | QuarkXPress Scripts | Finder Scripts | Image Companions | Utility Scripts


See ya'll soon.

Sal

comments