Jump to content

Recommended Posts

Posted

Good day,
I hope that the day finds you well!

If I understand things correctly, the total path length is either 255 or 260 "legal" characters.

In example LaunchMeA, the total path length is: 87
• F:\SMS\Lesson Manual\6 Staff Notation\Staff Notation\1 Introduction\2 The Staff\Images

In example LaunchMeB, the total path length is: 104
F:\SMS\Lesson Manual\6 Staff Notation\Staff Notation\2 Pitch Location\1 Visual Representation #1\Images

LaunchMeA works...however, LaunchMeB....does not?! May I aks "Why?"

Thank you for your time...appreciated!

; -----------------------------------------------
;~ LaunchMeA
; -----------------------------------------------
Opt("MustDeclareVars", 1)
; -----------------------------------------------
LaunchFirst()
LaunchSecond()
; -----------------------------------------------
Func LaunchFirst()
    Local $sSrcPath = "F:\SMS\Lesson Manual\6 Staff Notation\Staff Notation\1 Introduction\2 The Staff"
    ; -----------------------------------------------
    ShellExecute($sSrcPath)
    WinWait($sSrcPath, "")
    WinMove($sSrcPath, "", 1400, 10, 500, 440)
EndFunc   ;==>LaunchFirst
; -----------------------------------------------
Func LaunchSecond()
    Local $sSrcPath = "F:\SMS\Lesson Manual\6 Staff Notation\Staff Notation\1 Introduction\2 The Staff\Images"
    ; -----------------------------------------------
    ShellExecute($sSrcPath)
    WinWait($sSrcPath, "")
    WinMove($sSrcPath, "", 1400, 475, 500, 440)
EndFunc   ;==>LaunchSecond
; -----------------------------------------------
; -----------------------------------------------
;~ LaunchMeB
; -----------------------------------------------
Opt("MustDeclareVars", 1)
; -----------------------------------------------
LaunchFirst()
LaunchSecond()
; -----------------------------------------------
Func LaunchFirst()
    Local $sSrcPath = "F:\SMS\Lesson Manual\6 Staff Notation\Staff Notation\2 Pitch Location\1 Visual Representation #1"
    ; -----------------------------------------------
    ShellExecute($sSrcPath)
    WinWait($sSrcPath, "")
    WinMove($sSrcPath, "", 1400, 10, 500, 440)
EndFunc   ;==>LaunchFirst
; -----------------------------------------------
Func LaunchSecond()
    Local $sSrcPath = "F:\SMS\Lesson Manual\6 Staff Notation\Staff Notation\2 Pitch Location\1 Visual Representation #1\Images"
    ; -----------------------------------------------
    ShellExecute($sSrcPath)
    WinWait($sSrcPath, "")
    WinMove($sSrcPath, "", 1400, 475, 500, 440)
EndFunc   ;==>LaunchSecond
; -----------------------------------------------

 

Posted (edited)

The Problem is in File Explorer Window Title Length Limitation (for me 96 char)
The issue you're facing isn't with the path itself, but with the File Explorer window's title bar.
When a folder path is long, the Explorer window often truncates its title.
This makes it difficult for AutoIt's WinWait or WinWaitActive functions to correctly identify the window,
as they rely on matching the exact (or at least a sufficiently long part of the) window title.

you need to change your approach

suggested solution

Func LaunchFirst()
    Local $sSrcPath = "F:\SMS\Lesson Manual\6 Staff Notation\Staff Notation\2 Pitch Location\1 Visual Representation #1"
    ; -----------------------------------------------
    ShellExecute($sSrcPath)
    Local $hWnd = WinWaitActive("[CLASS:CabinetWClass; TITLE:" & StringLeft($sSrcPath, 90) & "]", "", 3)
    If $hWnd Then WinMove($hWnd, "", 1400, 10, 500, 440)
EndFunc   ;==>LaunchFirst

 

Edited by ioa747
missing &

I know that I know nothing

Posted

ioa747,

You have come through again...and "with flying colours"!!

I kinda' figur'd that the issue had to do with path length...just not sure how to correct the anomaly.

All tested and working as expected!

Thank you again...for your time, attention and patience to the above. All are very much appreciated!
• ios747, yo9u are indeed a true blessing to this forum!

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
  • Recently Browsing   0 members

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