Jump to content

My compiled script wont unpause.


Recommended Posts

Hi, all i've wrote a script that makes shift+n create a new folder but now that i have compiled it it won unpause. 

I've tried clicking it in the taskbar and i cant unpause it here is my code.

AutoItSetOption("WinTitleMatchMode", 4)
#include <MsgBoxConstants.au3>
;Set hot key to winkey and n and call new folder function
Local $folder = "\New Folder"
HotKeySet("+n", "NewFolder")

;infinite loop
While 1
  sleep(10)
WEnd

;new folder function
Func NewFolder()
   ;check to see if explorer is active window.
    If WinActive("classname=ExploreWClass") _
        Or WinActive("classname=CabinetWClass") Then
         Local $hWnd = WinGetHandle("[ACTIVE]","")
         Local $dirUnTrim = ControlGetText($hWnd,"", "ToolbarWindow322")
         Local $dir = StringTrimLeft( $dirUnTrim, 9)
         Local $initdirpath = $dir & $folder

         If FileExists($initdirpath) Then
            Local $dirpathnew = StringRight($initdirpath, 2)
            Local $a = StringTrimRight($dirpathnew, 1)
            Local $a1 = $a + 1
            Local $a2 = "(" & $a1 & ")"
            ToolTip($a2)
            $folder = "\New Folder" & $a2
            $dirpath = $dir & $folder
         Else
            $dirpath = $dir & "\New Folder"
         EndIf
         DirCreate($dirpath)
    Else
        ToolTip("")
    EndIf
    Sleep(10)
EndFunc

Im not quite sure what to do and dont know why it wont let me unpause.

Edited by Carrotlolz
Link to comment
Share on other sites

What you are after, is a resume ability, that I don't think AutoIt has ever had.

Your only option in this instance, is Exit.

If you want Pause and Resume, you need to code them yourself.

That said, you could probably benefit from checking out my New Folders program.

Or if all you want is to create a new folder whenever you click SHIFT+N (or somesuch) (I use CTRL+ALT+F)

then just create a shortcut to your program and assign the appropriate Hotkey there (it can be coded for too).

Edited by TheSaint

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

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...