Sign in to follow this  
Followers 0
davidg

Scripting a Ctrl+F5 keypress

4 posts in this topic

This is my first post here. I hope someone can help a beginner!

I am trying to develop a script which will automatically process a file in the ePublisher application. i can load the file but cannot get the program to recognise the Ctrl+F5 keypress which starts the processing. ePublisher uses Ctrl+F5 as shortcut for its 'Generate All' action, which is exposed as a menu command and as a toolbar icon.

I have tried using 'AutoIt Window Info' to identify the toolbar button concerned but no joy.

Here's what I've got:

#cs ----------------------------------------------------------------------------

AutoIt Version: 3.3.6.1

Author: David Green

Script Function:

Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

Run("C:\Program Files\WebWorks\ePublisher Express\WebWorks.ePublisherExpress.exe") ;starts ePublisher application

WinWaitActive("WebWorks ePublisher Express") ;wait until app opens

Send("^o") ;File->Open

Send("D:\HTML\PROJECT2\PROJECT2.wrp") ;enter file to open

Send("!o") ;Alt+O to click Open button

Send("{esc}") ;dismiss a dialog which sometimes appears

Send("^{F5}") ;Ctrl+F5 to process the file I've opened

Any ideas why the last line isn't working would be much appreciated.

D Green

Share this post


Link to post
Share on other sites



Could it be you are sending Ctrl+F5 too quick?

Maybe a Sleep() will help to pause a little to allow the app to load the file?


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Try adding Sleep(1000) between each Send() command unless you are very pressed for time. I find that fixes a vast majority of timing issues. Sometimes I wait 5 seconds or more, even.

Share this post


Link to post
Share on other sites

Thankyou both for your help!

I added Sleep(1000) before the last line and my Ctrl+F5 seems to be working.

David

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0