Welcome to MacBoardz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Running Applescripts within Appleworks

 
   Macintosh computer (Home) -> Apple Scripts RSS
Next:  Paste contents of clipboard into active applicati..  
Author Message
fergus

External


Since: Jun 09, 2008
Posts: 3



(Msg. 1) Posted: Wed Jun 11, 2008 10:45 pm
Post subject: Running Applescripts within Appleworks
Archived from groups: alt>comp>lang>applescript (more info?)

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 document. 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 reported 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 document
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 document
select document envelopename
paste
select text of document envelopename
set font of selection to "Helvetica"
set size of selection to 15
print front document with print dialog
close document envelopename without saving
on error theerror
close document envelopename without saving
display dialog theerror
display dialog "Unable to print envelope." buttons {"OK"}
default button "OK" with icon 0
end try
end tell

 >> Stay informed about: Running Applescripts within Appleworks 
Back to top
Login to vote
Simon Slavin1

External


Since: May 16, 2004
Posts: 543



(Msg. 2) Posted: Sat Jun 14, 2008 9:04 pm
Post subject: Re: Running Applescripts within Appleworks [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 11/06/2008, fergus DeleteThis @twig.demon.co.uk wrote in message <1e0bfc89-06de-
4521-b737-1e8a1af7acc3 DeleteThis @i76g2000hsf.googlegroups.com>:

> 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 document. 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 reported that the application
> "AppleWorks 6.2.9" encountered error -1727:
>
> "Expected a reference"

Read the documentation that comes with AppleWorks about how to write
scripts and take a look at the example scripts. A script run within
AppleWorks can't address AppleWorks in that way.

Simon.
--
http://www.hearsay.demon.co.uk

 >> Stay informed about: Running Applescripts within Appleworks 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
converting appleworks files - A friend of mine has got about 400 appleworks documents in the appleworks draw and appleworks word processor format. Is there a fast way of saving all of the appleworks draw documents to jpeg and all the appleworks word processor documents to the..

[Q] read write in AppleWorks - Hello! I am looking for read and write in an AppleWorks's document the script beneath (found in "AppleScript language guide" book) open the file then give an error message A similar script runs well with a Hypercard field under Cassic (with o...

(Q) Fill a AppleWorks spreadsheet -

Appleworks "Save as" dialog - I want to save an Appleworks drawing document as a JPEG. I say: <font color=purple> ; save front document in (File_Path as alias) as file type "JPEG"</font> (having prepared "File_Path" appropriately). The prob...

AppleWorks and Spreadsheet problems - I'm having trouble with Appleworks spreadsheets. I've found how to change the default font of a WP document to what's needed, but am stuck on Spreadsheets and haven't looked at databases yet. I need to open all the AW version 5 documents, change the..
   Macintosh computer (Home) -> Apple Scripts All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]