Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Applescript > Running Applesc...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 1622 of 1674
Post > Topic >>

Running Applescripts within Appleworks

by fergus@[EMAIL PROTECTED] Jun 11, 2008 at 10:45 PM

Hello all,

With the help of this group my envelop printing script is now as
follows. I am planning to use this within Appleworks 6. This script
runs fine from within the "script editor" with an address select
in an AW6 do***ent. However when I copy the script to the appleworks
script folder as an application it fails as follows:

    While executing the script "Print Seolection.app",
    the scripting system re****ted that the application
    "AppleWorks 6.2.9" encountered error -1727:

    "Expected a reference"

Regards Fergus.


   property envelopedoc : ""
   if FileMissing(envelopedoc) then
       set envelopedoc to choose file with prompt "Please select the
envelope template to use"
   end if

   on FileMissing(someFile)
       try
           set someFile to (someFile as text)
           set anAlias to (someFile as alias)
           return false
       on error
           return true
       end try
   end FileMissing

   tell application "AppleWorks 6.2.9"
       activate
       try
           set selectedText to selection of front do***ent
           if length of selectedText is less than 20 then
               say "Nothing worth printing"
               return
           end if
           set the clipboard to selectedText
           open envelopedoc
           set envelopename to name of front do***ent
           select do***ent envelopename
           paste
           select text of do***ent envelopename
           set font of selection to "Helvetica"
           set size of selection to 15
           print front do***ent with print dialog
           close do***ent envelopename without saving
       on error theerror
           close do***ent envelopename without saving
           display dialog theerror
           display dialog "Unable to print envelope." buttons {"OK"}
default button "OK" with icon 0
       end try
   end tell
 




 2 Posts in Topic:
Running Applescripts within Appleworks
fergus@[EMAIL PROTECTED]   2008-06-11 22:45:53 
Re: Running Applescripts within Appleworks
Simon Slavin <slavins.  2008-06-14 21:04:37 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 11:45:57 CST 2008.