davidg Posted May 20, 2010 Share Posted May 20, 2010 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 Link to comment Share on other sites More sharing options...
Developers Jos Posted May 20, 2010 Developers Share Posted May 20, 2010 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? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Yorn Posted May 20, 2010 Share Posted May 20, 2010 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. Link to comment Share on other sites More sharing options...
davidg Posted May 21, 2010 Author Share Posted May 21, 2010 Thankyou both for your help! I added Sleep(1000) before the last line and my Ctrl+F5 seems to be working. David Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now