Jump to content

Windows shortcut key delays script launch


Recommended Posts

I wrote a simple script for my job that has failed for an odd reason. We're running on Windows XP Pro, SP3.

This script is needed to get around a bug in a recent release that we just installed. I am copying some text from InCopy, pasting it into Notepad and copying it from there to strip out hidden codes. Then it can be pasted into a properties box without crashing the database application. Yeah, sounds like a pain but it'll be a few months before a fix will come from the vendor.

So the script works okay, now here's the problem ...

If I launch the script from a desktop or quick launch shortcut it will run just fine. But if I launch it using a Windows Shortcut Key (as defined in a shortcut's properties) there is a 30 second or so pause before the script starts.

Any idea what could be causing the long delay?

I don't think anything is wrong in the script but here it is, just in case.

BlockInput(1)
WinActivate("Adobe InCopy CS3")
If Not WinActive("Adobe InCopy CS3") Then Exit
Send("{CTRLDOWN}c{CTRLUP}")
Run("notepad.exe")
WinWait("Untitled - Notepad")
If Not WinActive("Untitled - Notepad") Then WinActivate("Untitled - Notepad")
WinWaitActive("Untitled - Notepad")
Send("{CTRLDOWN}v{CTRLUP}{CTRLDOWN}a{CTRLUP}{CTRLDOWN}c{CTRLUP}")
WinClose("Untitled - Notepad")
WinWaitActive("Notepad", "Do you want to save")
Send("!n")
WinWait("Adobe InCopy CS3")
If Not WinActive("Adobe InCopy CS3") Then WinActivate("Adobe InCopy CS3")
WinWaitActive("Adobe InCopy CS3")
Send("{ALTDOWN}f{ALTUP}")
Send("p{ENTER}")
WinWait("Text Document Properties")
If Not WinActive("Text Document Properties") Then WinActivate("Text Document Properties")
WinWaitActive("Text Document Properties")
BlockInput(0)
Link to comment
Share on other sites

This could be a problem with windows. The reason I say that because I had a very similar problem in the past when I created a shortcut key for the calculator. If i launched it from start menu everything was fine, but using the shortcut there was always a delay. Humor me and assign a shortcut to calc or something and see if a delay happens with that program. If so we know its not your script.

Link to comment
Share on other sites

Thanks for the reply, Beege.

I should have mentioned that other Shortcut Keys are also delayed. Even the WinKey+E or +R (Windows Explorer and Run) are delayed. Seems it may be connected to InCopy or our database app that supports it.

Just hoping that someone would spot something in my script that was creating the delay.

Link to comment
Share on other sites

  • 3 years later...

other Shortcut Keys are also delayed. Even the WinKey+E or +R (Windows Explorer and Run) are delayed.

Does the delay happen when you've been logged in for a while?  I get a huge delay between logging in and Windows responding to shortcut keys (e.g. Ctrl-Alt-B).  I've seen this on many versions of Windows.

Link to comment
Share on other sites

  • Moderators

denishowe,

Welcome to the AutoIt forum. :)

In fiture please look at the date when a thread was last active before you post. I doubt the OP, who has not been online here for over 3 years, is likely to respond. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...