Move focus to next document.

Help with writing and playing macros

Move focus to next document.

Postby Happy » Mon Sep 06, 2004 4:36 am

First Question

my code is:

Code: Select all
InsertMode
ColumnModeOff
HexOff
UnixReOff
ColumnModeOn
GotoLine 1
Key HOME
StartSelect
Key END
Copy
NextDocument
GotoLine 1
Find "^c"
IfFound
NextDocument
Paste
EndIf
ColumnModeOff


I have three open documents. In the first document i copy the first line to the clipboard. Then i change to the second document and search for the content of the clipboard. When the string is found, the macro should go to the third document and paste the clipboard content.
But this does not happen, the content of the clipboard is pasted in the first document instead.

Second Question:
When i save a file from a macro, how can the "save dialog" be suppressed?
User avatar
Happy
Newbie
 
Posts: 5
Joined: Thu Sep 02, 2004 11:00 pm

Re: Move focus to next document.

Postby Happy » Mon Sep 06, 2004 5:28 am

"NextWindow" instead of "NextDocument" is working. :)

But what about the "save dialog" ?
User avatar
Happy
Newbie
 
Posts: 5
Joined: Thu Sep 02, 2004 11:00 pm

Re: Move focus to next document.

Postby mrainey56 » Mon Sep 06, 2004 5:40 am

Happy,

Get rid of the "ColumnModeOn" line (which doesn't do anything useful in your macro anyway) and everything appears to work. Don't ask me why. 8O


If your open files have names already, the Save command shouldn't call up a dialog.
User avatar
mrainey56
Master
Master
 
Posts: 212
Joined: Tue Jul 27, 2004 11:00 pm
Location: Spartanburg, South Carolina

Re: Move focus to next document.

Postby Happy » Mon Sep 06, 2004 6:11 am

mrainey56 wrote:Get rid of the "ColumnModeOn" line (which doesn't do anything useful in your macro anyway) and everything appears to work.

I've removed "ColumnModeOn". "NextWindow" is working, "NextDocument" not. :cry:
User avatar
Happy
Newbie
 
Posts: 5
Joined: Thu Sep 02, 2004 11:00 pm

Re: Move focus to next document.

Postby mrainey56 » Mon Sep 06, 2004 7:03 am

Don't know what to say. This works on my system.

InsertMode
ColumnModeOff
HexOff
UnixReOff
GotoLine 1
Key HOME
StartSelect
Key END
Copy
NextDocument
GotoLine 1
Find "^c"
IfFound
NextDocument
Paste
EndIf
User avatar
mrainey56
Master
Master
 
Posts: 212
Joined: Tue Jul 27, 2004 11:00 pm
Location: Spartanburg, South Carolina

Re: Move focus to next document.

Postby Happy » Mon Sep 06, 2004 7:25 am

Maybe a version related problem. I have 10.10a.
User avatar
Happy
Newbie
 
Posts: 5
Joined: Thu Sep 02, 2004 11:00 pm

Re: Move focus to next document.

Postby wodder » Tue Sep 14, 2004 12:34 pm

Did you try this?

InsertMode
ColumnModeOff
HexOff
UnixReOff
GotoLine 1
Key HOME
StartSelect
Key END
Copy
NextWindow
GotoLine 1
Find "^c"
IfFound
NextWindow
Paste
EndIf
User avatar
wodder
Newbie
 
Posts: 2
Joined: Mon Sep 13, 2004 11:00 pm


Return to Macros