Reply to topic  [ 1 post ] 
Automatic Envelope Creation 
Author Message

Joined: 2003-04-30 13:01:17
Posts: 6
For everyone who misses automatic envelope creation, I have a working solution.

First create a new document.
Change the Page Setup to be '#10 Envelope' or whatever you envelope style as listed is and select the correct orientation for your printer.
Set the margins as follows (for #10 Envelope)
inner - 3.5in
outer - 2.0in
top - 1.65in
bottom - 0.95in

Note: I left the default headers/footer alone at 0.5in
Save this document as "envelope.rtf" in the "~/Documents/Nisus Documents" folder.
From the Finder, do a Get Info on "envelope.rft" and check 'Stationary Pad'

I create the envelope by calling an AppleScript from the macro menu that, in turn, calls a second AppleScript. Don't ask why it doesn't work from a single script -- it doesn't.

Here's the first script.

<applescript>
tell application "Finder"
set scriptPath to (((path to application support from user domain) as string) & "Nisus Writer:Macros:Envelope Maker.app") as alias
open scriptPath
end tell
</applescript>

Save this as "Envelopeā€¦", type Script, in the NWE Macros folder. Yes, that's an ellipsis.

Here's the second script.

<applescript>
tell application "Nisus Writer Express"
set docName to name of front window
get selected text of front document
set addressee to the result

tell application "Finder"
set myDocs to path to documents folder as string
open document file (myDocs & "Nisus Documents:envelope.rtf")
delay 1
end tell

activate
set envelopeName to name of front window
set text of document envelopeName to addressee

--clean up
set envelopePath to myDocs & "Nisus Documents:" & envelopeName
tell application "Finder"
move file envelopePath to trash
end tell
end tell
</applescript>

Save this as "Envelope Maker", type application, uncheck Startup Screen, in the NWE macros folder.

Now, making it work.

Select/highlight the complete address in any open document that you want an envelope made and then choose "Envelopeā€¦" from the Macro menu. A new envelope document will be created, brought to the front and the address inserted. Print it. The envelope document will be moved automatically to the Finder trash.

Enjoy.

_________________
Andy Fragen


2004-05-07 11:03:45
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software