Scripting Freehand 10

Does anybody have some experience in scripting the print settings in MacroMedia Freehand 10? I have been trying to script this, but it keeps giving me errors that either the document doesn’t understand or that Freehand can’t continue.

There is a complete list of print commands in the dictionary, but somehow they don’t seem to work. And the MacroMedia site doesn’t have sample documentation what so ever.

Any help would be welcome.

Casper,

I’m using v8 but think this might apply. I tried just setting the image data of the output options and got the error you were talking about. But if I included with or without include invisible, or with or without split complex it worked fine.

Try including 1 of the booleans and see if that does the trick.

Hope this helps

I have been using the options in the print command the whole time and it doesn’t change the problem. When you mentioned the output options, i tried it on that command and that works perfectly.

I don’t know if V8 has a print command listed, but can you try if it works in that version, because i only have version 10?

Actually you’re comment got me started on something different. I have been using the extra dialogs the whole time. I tried it again without the extra commands and i actually got FreeHand to display the printmenu.

It now looks as if the extra commands are causing the problem. However i actually need these commands to properly setup and activate the print command.

Any suggestions?

Casper,

Let me know specifically the command you are having problems on so I can run them here.

I am the same person who replied before - just forgot to log in.

Best,

This is the script sofar, added with the commands that i wish to execute on the print command in Freehand. The only way to get the print command to work is by removing “settingsFile” and “PaperWidth/PaperHeight” (the syntax compilation is OK).

property tryFile : “iBook HD:Desktop Folder:testfile” as alias

tell application “FreeHand 10”
activate
open tryFile
print tryFile SettingsFile “testsettings” PaperWidth “210 mm” PaperHeight “297 mm”
end tell

Casper,

The source of the error is when you tell FreeHand to print tryfile.
Just tell FreeHand to print, exclude “tryfile”. FH will print the
current document by default. If you have more than one page you
will have to specify that as well. Also, you were defining the
measurement units in the quotes that house the actual measurement.
FreeHand would rather you just put numbers in the quotes and
define the units just after (see below)

FYI, I’ve had better luck scripting FreeHand by tucking the
update command between every command. I know, sounds like
a waste of time and script resources. FreeHand, it seems likes
to skip commands if you don’t. Maybe v10 has that fixed, v8
will skip commands if they aren’t separated by an update command.

If all you are specifying is the page dimensions your code would read:

print PaperHeight "297" PaperWidth "210" Units MM

Or, if you want, you could set up your own PrintSet by setting
all the info up in the print dialogs, then go to the setup dialog.
Look near the top, there is a button and a menu for Print Setting.
Click the button with the “+” on it. This will allow you to save the
current settings as your print set. Then in your script it would look
like this:

print SettingsFile “iBook HD:Path to the FH 10 Print settings Folder:”

Best,

I tried your example also and when i skip the file reverence in the print command line, i get the following error message “Proceed impossible print” (translated from Dutch) and the code -1708. The Update command also doesn’t change anything on this.

What i already saw and i don’t know if you have that as well in Freehand 8, is that there are two print commands in the dictionary. One in the required suite that states print with an alias and the other in the Freehand suite that states print with a reference. The last one mentioned is also the one with all the optional commands. Could they be conflicting?

Yes, the FH8 dictionary contains Print commands in both the required and the FH suite.
But this line works for me just fine without errors.

print PaperHeight “297” PaperWidth “210” Units MM

Does this line of code generate the impossible print message?

Better yet, paste the actual line of code that is stopping your script.

The update command wasn’t meant as a fix for this problem. I just threw that in to be helpful as I know there can be potential problems when scripting many different consecutive actions in FreeHand. Send the line of code you are currently having a problem with. 8^)

Casper,

I think you still have “mm” in the paperwidth & paperheight quotes.

print PaperWidth “210 mm” PaperHeight “297 mm”

(If I do this I get the exact same error -1708 and a message of “Can’t continue print” which sounds just like the Dutch error message you are getting.)

Make sure your print command looks like this:

print PaperHeight “297” PaperWidth “210” Units MM

I have changed the line of code exactly the same as you mentioned it, but i keep getting the same error message over and over again. Even with different subcommands i keep getting the error message.

I think i will start looking for an older version of Freehand or can you maybe tell me which AppleScript version you are running? I’m running version 1.8.3 on Mac OS 9.2.2 (that’s installed by version 10 when starting classic mode for the first time).

I’m sorry i think i wasn’t exactly clear. i mean Mac OS X installed version 1.8.3 of the ApleScript extension when starting classic for the first time.

Casper,

I am using Applescript v1.6 under OS 9.2.1 but that shouldn’t have any bearing on the FreeHand print command.

Just curious, what happens if you remove the extra commands from the print command and just use “print” Does it print without any errors? Does it cut anything off the page? If you are getting errors with just the command Print you may have some other problem.

I’m stumped, print PaperHeight “297” PaperWidth “210” Units MM should work perfectly

The only other thing I can think of would be to copy everything from the original document and paste it into a template you have saved with the print settings but that is a tremendous waste.

Sorry I wasn’t able to help Casper.

Good luck,

When i just state print without the subcommands i get the message ‘can’t continue print’. I also tried setting the AppleScript extension back to version 1.6, but that also has no effect.

I even tried it in Mac OS X, but that gives me the same problems. I’m beginning to think that there is a major bug or something in Freehand 10 Applescript functionality.

Thanks for all your help.