Archives: pcmedia27
![]()
M A C R O M E D I A
C O M M O N S C R I P T I N GMacromedia Common Scripting (MCS) has been developed as a cross-product, cross-platform easy-to-use programming solution for all Macromedia applications. In each of our applications, users often perform tasks that require a number of sequential menu picks or dialog clicks. Providing scripting level access to user-level functionality enables those operations to be executed with a single Xtras menu item.
FreeHand 7 is the first Macromedia product to be fully integrated with this new scripting technology. By writing and compiling scripts with the new Macromedia Script Editor, users may now automate such tasks as batch conversion of files to any FreeHand supported file format, batch printing with specified output options, and multiple object selections based on fill type and other criteria.
The Macromedia Script Editor and the Macromedia Scripting language are based upon Sun Microsystems' Java programming language (in fact, the Script Editor is the first publicly released productivity application written entirely in Java). Comprehension of Java is required to create script Xtras. Scripts are written and compiled in Java within the editor and may be run on Power Macintosh, Windows 95, or Windows NT 3.5/4.0 systems without recompiling or making multiple versions. Once a compiled script has been placed in the FreeHand Xtras folder it acts like any other Xtra recognized by FreeHand, and appears under the Xtras menu in a category specified within the editor by the user.
Using MCS with FreeHand 7
- Make sure that the Macromedia Scripting Engine was installed when you installed FreeHand.
If you chose Easy when you installed FreeHand, the Scripting Engine is installed. If you chose another installation option, launch the FreeHand installer again, choose Custom install, and select only the Macromedia Scripting Engine.
- Enable the Java run-time within FreeHand.
In the FreeHand Preferences dialog, check the General > Editing > "Enable Java Scripts (relaunch to apply)" preference.
- Quit and relaunch FreeHand.
- Place scripts in the FreeHand > Xtras folder.
Macromedia scripts will appear as menu items in the Xtras menu.Sample Scripts
A collection of sample scripts are included with the Script Editor installer and can be found within the Macromedia Script Editor folder. Each of the scripts provided is compiled and fully functional within FreeHand. However before running the Xtras in FreeHand, it is recommended that you open a script in the Macromedia Script Editor to learn what the script does and how it is used. For example, some scripts perform an action on the currently selected object, therefore you must have a selection before choosing the Script in the Xtras menu.
These samples also serve as an excellent learning tool for any user who is interested in creating their own personalized scripts. Many of the methods and variables which make up the FreeHand API are used in these scripts.
Below is a brief description of the intended functionality of each of the Sample Scripts.
AddPagesPrepare to Download...
A series of dialogs asks for a number of pages, size in inches and a bleed size and then creates the desired number of pages in the current FreeHand document or, if no document is open, creates a new file which contains the specified pages.AnimateLayers
This script is useful for animators or artists who wish to create animated GIFs for use on the World Wide Web. When launched, the script changes all layers in the FreeHand file to invisible and then turns each one "on" and "off" successively. The Foreground layer, when left in its default place in the layer order, serves as a background for the animation. (The Background and Guides layers are ignored.) Optionally, the user may edit the script in the Macromedia Script Editor, using code provided, to either export each layer as a successively named and numbered GIF file or control the speed with which the animation occurs.ConvertToFH7
This script converts selected files to native FreeHand 7 files. The script saves the new FH7 file with the same name as the original with the suffix changed to ".FH7"ConvertTextToNonPS
This script turns on a hidden preference in FreeHand which converts text to paths when printing to non PostScript printers.CreateBkground
This script copies the currently selected object or group and then pastes them in random locations on the current page. It also randomly sizes and rotates the objects after pasting. The user is asked to specify the number of copies to be made.ExportSpin
This script has functionality similar to the AnimateLayers script. Instead of going through layers and exporting each, this script takes a selected object, rotates it a predetermined amount, and exports it as a GIF file before rotating again. The script continues until the object has rotated 360 degrees.RemoveContents
This script removes any objects that are pasted inside clipping paths in the current document.RemoveHalftones
This script removes any object-level halftones in the current document.RemoveInvisibles
This script removes any invisibles such as stray points, empty text boxes and objects with no stroke and fill in the current document.RemoveOverprint
This script removes any object-level overprinting in the current document.RemovePages
This script deletes a specified range of pages within the current document.ScaleAllObjects
This script prompts for an x and y percentage and scales all objects in the document to that percentage.SelectBasicFills
This script selects all objects in the current document with basic fills.SelectNamedObjects
This script asks for a name and selects all objects in the current document with that name as set with the Set Note Xtra.SelectSameFill-Stroke
This script selects objects with the same fill color and/or stroke as the currently selected object.SelectStrokeByPointSize
This script prompts for a point size and selects all strokes with that point size.Simplify Paths
This script simplifies all paths of more than 100 points with a tolerance of 5.Spiral
This script takes the currently selected object and rotates it as it enlarges and shrinks the object in size; creating a 3-d animation effect.
Macromedia Scripting is an exciting new tool for anyone who uses Macromedia applications. MCS and Java are rapidly changing technologies, so be sure to visit our Web Site often for the latest information about Macromedia Scripting, updates, and integration with other Macromedia products.
Check back here soon for more sample scripts, examples of artwork created using MCS (backgrounds, animated GIFs, etc.), and in-depth help, tips, and tricks.
As you begin using MCS in your daily work, let us know if you have any suggestions, praises or complaints--we're committed to keeping a firm step ahead, and that will only happen if you pass along your comments. Thanks!
Download MCS
shockwave +
software +
sales +
support +
about macromedia +
macromall
contact us +
search +
home +
help +
graphics/text