Hi
Can someone explain to me why I can do ctrl N when there is focus on microsoft outlook manually and it opens a new email, but if i use scripting, the new email window never opens and focus comes off microsoft outlook???
Please see my sample below:
Let>filename=C:\Program Files\Microsoft Office\Office10\outlook.exe
Wait>.3
ExecuteFile>filename
WaitWindowOpen>Microsoft Outlook
wait>.2
setfocus>Microsoft Outlook
wait>2
press LCTRL
wait>.2
SendText>N
wait.2
Release LCTRL
//this times out as well
waitwindowopen>Untitled Message - Microsoft Word -*
setfocus>Untitled Message - Microsoft Word
wait>3
//TO: [email protected]
SendText>[email protected]
Cant open new outlook email with Ctrl N
Moderators: Dorian (MJT support), JRL
Cant open new outlook email with Ctrl N
Just when you thought it was safe to go in the water........
Other thoughts:
use
Press CTRL
rather than
Press LCTRL
from Microsoft
Try
Press CTRL
Press Shift
Send>m
Release Shift
Release CTRL
use
Press CTRL
rather than
Press LCTRL
from Microsoft
Try
Press CTRL
Press Shift
Send>m
Release Shift
Release CTRL
JRL wrote:Other thoughts:
use
Press CTRL
rather than
Press LCTRL
from Microsoft
Try
Press CTRL
Press Shift
Send>m
Release Shift
Release CTRL
Ok I did try this and got it to work, but I also got the CTRL N to work finally as well but I had to rem the Setfocus line after the waitwindow open for Microsoft outlook. Now it opened a new email just fine both ways. For some reason setfocus doesn't focus in a way that the scripting is appreciating... Isn't it better to use Setfocus on the windows??
WaitWindowOpen>Microsoft Outlook
wait>2
//setfocus>Microsoft Outlook
wait>2
press LCTRL
wait>.2
SendText>n
wait.2
Release LCTRL
wait>1
waitwindowopen>Untitled Message - Microsoft Word
//setfocus>Untitled Message - Microsoft Word
wait>1
p.s. had no problem with ALT S to send
Regards
Just when you thought it was safe to go in the water........
- CyberCitizen
- Automation Wizard
- Posts: 721
- Joined: Sun Jun 20, 2004 7:06 am
- Location: Adelaide, South Australia
Yes you need to set focus to the window first, don't always assume that it has focus, had issues with Outlook previously with a similar issue.
Also when sending a command to a window always use the lower case letter.
One other thing, something I used to streamline things is to use mailto:
Example Below
Also when sending a command to a window always use the lower case letter.
One other thing, something I used to streamline things is to use mailto:
Example Below
Code: Select all
Let>INPUT_BROWSE=0
Input>EmailAddress,Please Enter The Email Address,[email protected]
Input>Subject,Please Enter The Email Subject,Test Script Example
Exe>mailto:%EmailAddress%?subject=%Subject%
FIREFIGHTER
Cyber thats the problem with setfocus, it's not working to allow me to open the new email after outlook opens. If I open outlook and do nothing else except ctrl n it will initiate a new email message, but if I setfocus after outlook opens, then ctrl n will not work. So somehow the setfocus is focusing but it's not. Maybe we can share a session, as seeing is believing......CyberCitizen wrote:Yes you need to set focus to the window first, don't always assume that it has focus, had issues with Outlook previously with a similar issue.
Also when sending a command to a window always use the lower case letter.
Just when you thought it was safe to go in the water........
- CyberCitizen
- Automation Wizard
- Posts: 721
- Joined: Sun Jun 20, 2004 7:06 am
- Location: Adelaide, South Australia
- Marcus Tettmar
- Site Admin
- Posts: 7391
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
SetFocus will give you an error if no matching window is found.
If you are not getting an error then it must be finding a match.
But if keystrokes aren't landing then the wrong window is focused.
Therefore there must be a hidden window or some other window that your SetFocus is finding and it's not activating the one you think it is.
Try narrowing things down and specifying visible windows only by setting WF_TYPE accordingly.
If you are not getting an error then it must be finding a match.
But if keystrokes aren't landing then the wrong window is focused.
Therefore there must be a hidden window or some other window that your SetFocus is finding and it's not activating the one you think it is.
Try narrowing things down and specifying visible windows only by setting WF_TYPE accordingly.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
I checked again with the screens and made a change to the application name in my script. This time around it is working with the setfocus. Instead of setting focus on microsoft outlook I changed it to Inbox - Microsoft outlook. I had tried that out the gate, but it timed out. Now it appears it finds the window and takes the commands from the script.Marcus Tettmar wrote:SetFocus will give you an error if no matching window is found.
If you are not getting an error then it must be finding a match.
But if keystrokes aren't landing then the wrong window is focused.
Therefore there must be a hidden window or some other window that your SetFocus is finding and it's not activating the one you think it is.
Try narrowing things down and specifying visible windows only by setting WF_TYPE accordingly.
Let>filename=C:\Program Files\Microsoft Office\Office10\outlook.exe
//Let>filename_1=c:\Temp\MacolaAdjust\2013\macolaAdjust.txt
Let>filename_1=c:\Temp\MacolaAdjust\2013\Adjusttime.txt
Wait>.3
//Start outlook
ExecuteFile>filename
WaitWindowOpen>Inbox - Microsoft Outlook
wait>2
//Start notepad
ExecuteFile>filename_1
WaitWindowOpen>Adjusttime.txt - Notepad
setfocus>Adjusttime.txt - Notepad
wait>2
//re-set focus to outlook
setfocus>Inbox - Microsoft Outlook
wait>2
press LCTRL
wait>.2
SendText>n
wait.2
Release LCTRL
wait>5
waitwindowopen>Untitled Message - Microsoft Word
setfocus>Untitled Message - Microsoft Word
wait>1
//send email info TO: [email protected]
sendText>[email protected]
I wanted to use the smtpSendmail but didnt seem to get it working. Not sure if its a port issue as I don't know the ports they are using for email here.
Thanks to everyone who chimed in on this posting.
Just when you thought it was safe to go in the water........