Mac Help Forums


Reply
Thread Tools Display Modes

More applescript problems...

 
Member
kmancat's Avatar
Join Date: Dec 2005
Posts: 22
 
      15th January 2006
how do I check if an AppleWorks document is open? the way I do it now is this:

if "Macintosh HD:Users:KmanCat:Documents:ADocument.cwk" is (open) then

Last edited by kmancat; 15th January 2006 at 10:07 PM..
 
Reply With Quote
 
 
 
 
Ric Ric is offline
Senior Member
Ric's Avatar
Join Date: May 2004
Posts: 4,260
 
      15th January 2006
Hi there,

haven't got AppleWorks but try this...

Open the AppleScript "Check open document" in a new Script Editor window.

...replace textedit with AppleWorks...

regards

Ric
 
Reply With Quote
 
Member
Join Date: Nov 2005
Posts: 47
 
      16th January 2006
Here is another way. Use a tell for AppleWorks, and put the name of every open document into a list:


set c to {}
tell application "AppleWorks 6"
set b to count every document
repeat with d from 1 to b
set end of c to document d's name
end repeat
end tell


Hope this helps.

CAS
 
Reply With Quote
 
Member
kmancat's Avatar
Join Date: Dec 2005
Posts: 22
 
      16th January 2006
I don't think either of these are what i need...What i need is something that will run until a certain document is opened, at which point it opens a DIFFERENT document as well. this is my entire code...

Quote:
on idle
if file "Macintosh HD:Users:KmanCat:Documents:Document1.cwk" is (open) then
tell application "AppleWorks 6"
open document "Macintosh HD:Users:KmanCat:Documents:Document2.cwk"
end tell
end if
end idle
the problem is that when i run the program, it says
Quote:
<<script>> doesn't understand the "open" message
 
Reply With Quote
 
Member
Join Date: Nov 2005
Posts: 47
 
      16th January 2006
I see what you mean. Depending on how much memory it takes, you may need to utilize a handler that accesses AppleWorks and checks to see if a particular document is open or not. I believe that would be excessive. I am also unsure if the Finder can tell which documents are open inside of which applications, so you may be stuck with that anyway.

This would be an excellent post for MacScripter.net:

http://bbs.applescript.net/viewforum.php?id=2

CAS
 
Reply With Quote
 
Ric Ric is offline
Senior Member
Ric's Avatar
Join Date: May 2004
Posts: 4,260
 
      16th January 2006
Can I ask what the documents do ?

Understanding what you are trying to do may help in 'effecting' the right script for you...

...unless of course this has been answered at Macscripter !

Quote:
This would be an excellent post for MacScripter.net:
Not a bad post for here either...

;-)
 
Reply With Quote
 
Member
kmancat's Avatar
Join Date: Dec 2005
Posts: 22
 
      16th January 2006
No, I have not posted it in MacScripter...
The documents are just word processing .cwk's (the extension for AppleWorks). If it would make it easier, I could turn them into MS Word files...
 
Reply With Quote
 
Member
Join Date: Nov 2005
Posts: 47
 
      16th January 2006
Quote:
Not a bad post for here either...
Now Ric, don't get yourself all excited about my offering up MacScripter.net. I consider myself a slightly above average scripter, especially with AppleWorks. It just so happens that there are about a half dozen top notch scripters that check into MacScripter along with a couple hundred average types like myself. It is a great forum for more involved scripting issues, which I believe this may very well be.

I have been trying to keep an eye on your AS forum here, simply because I like scripting and would be happy to try to assist anyone that needs it.

Craig
 
Reply With Quote
 
Ric Ric is offline
Senior Member
Ric's Avatar
Join Date: May 2004
Posts: 4,260
 
      16th January 2006
Quote:
Originally Posted by kmancat
No, I have not posted it in MacScripter...
The documents are just word processing .cwk's (the extension for AppleWorks). If it would make it easier, I could turn them into MS Word files...

Not sure if you understood me correctly...

Is it just the case, that you want document 'x' to open when document 'y' is opened ?

Is it always the same two documents ?

regards

Ric
 
Reply With Quote
 
Member
kmancat's Avatar
Join Date: Dec 2005
Posts: 22
 
      16th January 2006
oops...yeah i misunderstood you.

yes it is always the same two, and yes I want document 'x' to open when document 'y' is opened.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AppleScript Language Guide for AppleScript 2.0 Patrick Stadelmann AppleScript 0 12th March 2008 05:00 PM
How To Call AppleScript Within AppleScript Jim Hines AppleScript 0 7th July 2007 04:18 AM
NFS automount and Applescript problems Larry Moss Mac 1 23rd March 2006 06:59 AM
Problems with a SOAP request with Applescript and a .NET webservice DMB AppleScript 0 25th July 2005 09:58 PM
Delay between Applescript end and Applescript App Closing Lucanus AppleScript 2 14th September 2003 11:38 PM


All times are GMT +1. The time now is 02:19 PM.
Mac-Help.com is an independent website and is not affiliated with Apple Inc.


Welcome!
Welcome to the Mac Help Forums
 


Latest Threads
New book about Steve Jobs << take part in it!
Arjan (4 Hours Ago, 09:37 AM)

Help! Stupid computer is automatically logging me out
Elizaboo (15 Hours Ago, 10:41 PM)

URGENT Help. Crazy talk Mac!
Joeker (16 Hours Ago, 09:42 PM)

PDF Document
yura (1 Day Ago, 12:13 PM)

Difficulties with internet speed (nothing to do with connection)
sammethh (1 Day Ago, 06:36 AM)

 


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51