Help! - if exist, run. Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ThiefUK
Posts: 19
Joined: 25 Jul 2017, 10:23

Help! - if exist, run.

23 Mar 2018, 11:42

Hi All

Having some trouble with second part of my script.

Currently:

Code: Select all

F10::


Loop, %clipboard%\*.* ,0,1
{
if A_LoopFileExt in jpg,msg
msgbox, found!

}
Which is scanning a copied path for a msg and jpg but then I want to run (open) said found files.

I tried a, run, %clipboard%\*msg but it failed to locate it.

Any help?

Thanks!
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Help! - if exist, run.

23 Mar 2018, 16:31

Code: Select all

F10::
    Send, ^c    ; copy selected text/path to clipboard
    Loop % clipboard . "\*.??g", 0 , 1    ; select only *.??g files
    {
        If A_LoopFileExt in jpg,msg
            Run, % A_LoopFileName
        }
    Return
Not tested.
ThiefUK
Posts: 19
Joined: 25 Jul 2017, 10:23

Re: Help! - if exist, run.  Topic is solved

26 Mar 2018, 14:17

Thank you BoBo.

The script failed to open the file however I've amended below which worked!

Code: Select all

F10::
    Send, ^c    
    Loop % clipboard . "\*.??g", 0 , 1   
    {
        If A_LoopFileExt in jpg,msg
            Run, % A_LoopFileFullPath
        }
    Return
Thanks!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Joey5, RandomBoy and 347 guests