no luck with existinglister
in this example i can seletle a path in any text doc, and sed it it do opus.
%A_ScriptDir%\x ahks x.ahk
ahk expand the script dir its
C:\Users\CLOUDEN\Documents\AutoHotkey\x ahks x.ahk
this function cleanuppathstring()
splits the path if a file is at the end it splits at the last dir and selected the file.
if only a dir is selected it will find an existing tab.
if the file is selected it will open a new tabs, ignored the other 7 i just opened.
pgdn:: ; %A_ScriptDir%\x ahks x.ahk
OpenDIRselection:
Global ClipSaved, filename, dir, ext, filestem, drive, lastfolder
iflive()
sleep 75
cleanuppathstring()
sleep 75
if (FileExist(Clipboard)) ; Check if it's a file or directory ; //If path exists
{
FileGetAttrib, Attributes, %Clipboard%
if (InStr(Attributes, "D")) ; If it's a directory
{
try Run, %Clipboard% ; Open folder
sleep 20
restoreclipboard()
Return
}
else ; If it's a file
{
try Run, %dopusrt% /cmd Go "%Clipboard%" NEWTAB TOFRONT EXISTINGLISTER
catch
Run explorer.exe /select`,"%clipboard%"
sleep 20
restoreclipboard()
Return
}
}
else if InStr(Clipboard, "%") ; If it contains environment variables
{
try Run, %dopusrt% /cmd Go "%Clipboard%" NEWTAB TOFRONT EXISTINGLISTER
catch
try Run explorer.exe /select`,"%clipboard%"
sleep 20
restoreclipboard()
Return
}
else ; If the path doesn't exist, show the "Directory Not Found" message
{
ToolTip, Directory Not Found
Sleep, 1500
ToolTip
sleep 20
restoreclipboard()
sleep 100
}
return
is there away to use go on the dir and select the file?
SplitPath, Clipboard, filename, dir, ext, filestem, drive ;; from the cleanuppathstring()
;; it could be..
try Run, %dopusrt% /cmd Go "%Dir%\%filename%" NEWTAB TOFRONT EXISTINGLISTER
that works only for the dir, ignoreing the file