More applescript problems...

Joined
Dec 30, 2005
Messages
22
Reaction score
0
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
 
Joined
Nov 25, 2005
Messages
47
Reaction score
1
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
 
Joined
Dec 30, 2005
Messages
22
Reaction score
0
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...

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
<<script>> doesn't understand the "open" message
 
Joined
Nov 25, 2005
Messages
47
Reaction score
1
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
 

Ric

Joined
May 14, 2004
Messages
4,260
Reaction score
5
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 !

This would be an excellent post for MacScripter.net:

Not a bad post for here either...

;-)
 
Joined
Dec 30, 2005
Messages
22
Reaction score
0
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...
 
Joined
Nov 25, 2005
Messages
47
Reaction score
1
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
 

Ric

Joined
May 14, 2004
Messages
4,260
Reaction score
5
kmancat said:
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
 
Joined
Dec 30, 2005
Messages
22
Reaction score
0
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.
 
Joined
Dec 30, 2005
Messages
22
Reaction score
0
That isn't what i was thinking, but it works better than what i wanted! Thanks!

(wow...why didn't I think of that!?)
 
Joined
Nov 25, 2005
Messages
47
Reaction score
1
That is probably the best idea, Ric. Here is a script that will work with AppleWorks:

tell application "AppleWorks 6"
activate
open file "FULL:pATH:TO:DOCUMENT:A"
open file "FULL:pATH:TO:DOCUMENT:B"
end tell

When you run it, both documents will open to their most previously saved parameters. So, if you had one on the left of the screen, and one on the right when last you accessed them, they should come back the same way.

Good luck,

CAS
 

Ric

Joined
May 14, 2004
Messages
4,260
Reaction score
5
kmancat said:
That isn't what i was thinking, but it works better than what i wanted! Thanks!

(wow...why didn't I think of that!?)

No problem !

glad it works for you.

regards

Ric
 

Ric

Joined
May 14, 2004
Messages
4,260
Reaction score
5
casdvm said:
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


just my sense of humour...the wink at the end of the post, should have been emphasized more !

All help is much appreciated !

regards

Ric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top