Insert Picture Macro Problem

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Tom Ewanco

Insert Picture Macro Problem

Post by Tom Ewanco » Thu Jun 12, 2003 6:50 pm

In the Beginner’s Guide to Scripting Windows with Macro Scheduler (p5) it states: “It is also advisable to try to avoid mouse events, as these are subject to window placement, which can vary. Although there are ways round this, such as running apps maximized, and using Macro Scheduler’s relative mouse move commands, it is usually possible to use the alternative keyboard shortcuts, and in most cases this improves the reliability and efficiency of scripts.”

I am working with a programmable keypad and am linking numerous bitmaps to keep the Word 2000 document size down. I have set up a macro, activated by the keypad, that takes me to the Insert Picture window. The macro then ends and I select the appropriate .tif file for linking.

I then run into a problem on the next macro in trying to access the Link to File selection.

The issue is in the Insert Picture window. Typically if I hit Alt plus the underlined letter (in this case Alt S for 'Insert'), I would then be able to go to another window or pulldown menu and select Alt+ L for 'Link to File.' Instead, the picture becomes prematurely permanently inserted and not linked.

I am wondering if this is a program glitch? I notice that there is another subselection for 'Insert' after hitting the down arrow. Is there a way of actuating the down arrow to access the submenu?

I am thinking that my current script needs a MouseMoveRel command so that no matter where the Insert Picture window is, the next mouse movement will find the target (the down arrow). I am puzzled though because the Insert Picture window appears to be consistently in the same position. (An add-on question, how are the destination coordinates determined?)

Another problem that I am having is that the Macro Scheduler hotkey assignment does not appear to work either manually via keystroke or via the keypad. It does however, work when activated by using the Macro Scheduler window “Run” icon and also Control R. But, having to open the MS window is counterproductive.

Is there a hard script solution that could address this issue?

Here is a sample script that works when activated in the MS window.


Let>WW_TIMEOUT=5
CapsOff
WaitWindowOpen>Insert Picture*
MoveWindow>Insert Picture,212,168
ResizeWindow>Insert Picture,599,385
Wait>0.17
LClick
Wait>0.17
MouseMove>797,510
Wait>0.35
LClick
Wait>0.3
MouseMove>783,550
Wait>0.3
LClick
Wait>1.03



Thanks in advance,

Tom

Lumumba

Post by Lumumba » Thu Jun 12, 2003 9:08 pm

Choose the keyboard shortcut of the field/button to set the filetype (ALT+T ?). Now after an additional TAB+DOWN+ShortcutCharacter you should have inserted the image based on your favourite option.

Code: Select all

Press ALT
Send>IPFT
Release ALT
//Now you select the insert button
Press TAB
//Now you get the dropdown list
Press Down
//Choose favourite option by sending the assigned character (e.g. Link to file)
Send>K
Sorry I'm using Word2K with another lang. setting. Therefore the shortcuts could be named different. Please check ...

Tom Ewanco

Insert Picture Macro Problem

Post by Tom Ewanco » Fri Jun 13, 2003 12:15 pm

L: Thanks! Works fine. However, can't seem to have the assigned shortcut key to execute, no matter what I do. Any thoughts?

Regards,

Tom

Lumumba

Post by Lumumba » Fri Jun 13, 2003 12:56 pm

That's what i've found in Word's help:

Reduce the size of my file by linking instead of inserting graphics

1 Click where you want to insert the graphic.
2 On the Insert menu, point to Picture, and then click From File.
3 Click the picture you want to insert.
4 Select the Link to file check box.
5 Clear the Save with document check box.
6 Click Insert.

You can see the picture in your document, but you can't edit it in situ, or in place. The picture will print with the document. However, you won't be able to see or print the picture if you break the link for example, if you copy the document to a floppy disk.


What I've understand from that: You can see the picture, but it's not embeded for real, it's "linked" to the place where you've selected it (from your HD). So to use the term "link" is different as we're used to know it from the internet. Have a try:

a) link the picture to your worddoc
b) rename the picture
c) Ooops, it shouldn't be displayed, right? The link has broken.

I think you're assumption is based on something like --> Insert/Hyperlink (CTRL+K)

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts