topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday December 6, 2024, 1:40 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: Adapt emptytxtfile.ahk to windows 8.1  (Read 23416 times)

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Adapt emptytxtfile.ahk to windows 8.1
« Reply #25 on: August 11, 2015, 06:59 AM »
It's a really strange thing .
Goes well in windows 7 and now....
As tomos said :
try it anyway - cant hurt! (I think e.g. UAC can still limit software)
under windows 7 i also deshabilitated the UAC feature.
 :-[

I dont understand - [1] did you try it in 8 ? (right-click, run as admin)
[2] Did it work?


EDIT// win 7 & win 8 work differently - that is why it's good to try ;-)

I disable UAC on everything.  Still Vista is more restrictive than XP, W7 more than Vista, and W8 more than W7.
Even my MoveIt program that just moves windows around, I run as Admin on W8.

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: Adapt emptytxtfile.ahk to windows 8.1
« Reply #26 on: August 13, 2015, 10:56 AM »
A mistery then. I am the administrator Tomos.
 :-*

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: Adapt emptytxtfile.ahk to windows 8.1
« Reply #27 on: August 13, 2015, 10:59 AM »
I am going to try this :
as well say tomos may be the autohotkey version i use is for windows 7, very different to windows 8

I am sure i am using the same version, because i don't download the new one.

Then we'll comment

Best Regards
 :P

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: Adapt emptytxtfile.ahk to windows 8.1
« Reply #28 on: August 13, 2015, 01:28 PM »
I am afraid i have the last one : v1.1.22.03

may be some incompatibility with the windows spanish version ?
 :(

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,964
    • View Profile
    • Donate to Member
Re: Adapt emptytxtfile.ahk to windows 8.1
« Reply #29 on: August 13, 2015, 02:25 PM »
A mistery then. I am the administrator Tomos.
 :-*

my point is this:
I believe 'running as administrator' can make a difference - even if you are the administrator.
I may be wrong - but will you please try it - it will either work, or not, and we can then drop it...
Tom

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: Adapt emptytxtfile.ahk to windows 8.1
« Reply #30 on: August 13, 2015, 03:21 PM »
running to try tomos.

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: Adapt emptytxtfile.ahk to windows 8.1
« Reply #31 on: August 13, 2015, 03:36 PM »
Sorry. Don't go.
 :(

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,964
    • View Profile
    • Donate to Member
Re: Adapt emptytxtfile.ahk to windows 8.1
« Reply #32 on: August 13, 2015, 04:48 PM »
Sorry. Don't go.
 :(

okay, I can drop it now :D :Thmbsup:
Tom

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: Adapt emptytxtfile.ahk to windows 8.1
« Reply #33 on: August 13, 2015, 07:18 PM »
I am updating to windows 10 and perhaps is different althoug i doubt....
 ;D

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: Adapt emptytxtfile.ahk to windows 8.1
« Reply #34 on: August 14, 2015, 05:15 AM »
I've debugged a little on Windows 10 and came to these changes:
OLD CODE:
Code: Autohotkey [Select]
  1. HWND := WinExist()
  2.       ControlGetText, DesPath, Edit1, ahk_id %WinID%
  3.       Gui, Add, ListView, r10 NoSort vChosenName h300 w400, File Name

NEW CODE:
Code: Autohotkey [Select]
  1. HWND := WinExist()
  2.       ControlGetText, DesPath, ToolbarWindow323, ahk_id %WinID%
  3.       StringMid, DesPath, DesPath, Instr(DesPath,": ") + 2
  4.       Gui, Add, ListView, r10 NoSort vChosenName h300 w400, File Name
(2nd line changed, 3rd line added)

The text from this control comes prefixed with "Address: " on a US-English Windows installation, and "Adres: " with the Dutch language pack active (I have separate logins for separate languages on this Windows 10 system 8)), so the string-splitting is based on the ": " part.
I'm no expert on AHK, but it "Works On My Machine" (r) ;D
Can't test with Windows 7 (at the moment) or Windows 8.x (at all as I don't have that @#$#%-OS here), but as Windows Explorer has a lot of similarities I sortof assume it should work there too. Else use the AHK Window Spy to get the control-name that holds the address for the current folder:
Screenshot - 14-08-2015 , 12_08_09.png

Only once the address is selected it reveals the Edit1 control as used in the original code:
Screenshot - 14-08-2015 , 12_13_20.png

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: Adapt emptytxtfile.ahk to windows 8.1
« Reply #35 on: August 14, 2015, 06:35 AM »
 ;D
i will try and don't give in because a problem well stated is a problem half-solved (charles kettering)

At the present moment i am updating to windows 10 and seems to take a while. Meanwhile i will try the new code anyway.
 :-*

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: Adapt emptytxtfile.ahk to windows 8.1
« Reply #36 on: August 14, 2015, 06:40 AM »
 :-[
It seems i am lost.
Could you please post all the new code again (complete script) to try ?
I am not able to find the part of the code to be replaced.

Best regards
 :o

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: Adapt emptytxtfile.ahk to windows 8.1
« Reply #37 on: August 14, 2015, 08:12 AM »
I started off with the script you originally posted, and implemented the suggestion by MilesAhead using "#IfWinExists ahk_class ... " instead of "#if WinExists(...)", though that doesn't matter much (tested both, worked just fine)
Then I tried to find the reason it didn't get the value for the DesPath variable, trying to understand how it got it in the first place. Then used the AHK AutoIt3 Window Spy tool that comes with the AHK installer to find the control-name for the current Path of the Explorer window, parsed it to remove the Address: prefix, and 'et voila', working 8).
BTW, I've compiled the script into a .exe, and it works both compiled for x86 (32 bit Unicode) or x64 (64 bit Unicode). I think the Unicode compilation is required for current Windows versions, to enable it working for *any* Language-locale. Doesn't need to be Run As Administrator (though I still have UAC enabled).

This is my current script: (Didn't do any nice indenting or comments :-[, only added the current path to the "File Name" first line of the list)
Code: Autohotkey [Select]
  1.      
  2.     #ifWinActive ahk_class CabinetWClass
  3.     {
  4.       #y::
  5.       Gui, Destroy
  6.       WinGet, WinID, ID, A
  7.       Gui, +LastFound
  8.       HWND := WinExist()
  9.       ControlGetText, DesPath, ToolbarWindow323, ahk_id %WinID%
  10.       StringMid,DesPath,DesPath,Instr(DesPath,": ") + 2
  11.       Gui, Add, ListView, r10 NoSort vChosenName h300 w400, File Name (Path: %DesPath%)
  12.          For A,B in {1:"Instrucciones.txt",2:"Instalar en mv.txt", 3:"Es mal portable. Instalar como no portable.txt", 4:"Instalado como portable.txt", 5:"Instalar cuando se pueda.txt", 6:"ReciboLLamadaAlas.proponer fecha hora.txt", 7:"Ver pantallazos.proponer fecha hora.txt", 8:"Ver grabaciones de la fecha.proponer fecha sistema.txt", 9:"password   pegado del portapapeles.txt", 10:"Avira detecta virus. en parte a especificar.txt", 11:"File11.txt", 12:"Es un juego.txt", 13:"Es para entorno MAC Apple.txt", 14:"Tambien tienen versiones de pago.txt", 15:"No es buen portable.Instalado como portable.txt",16:"No funcione en xp. es para w7 o sup.txt", 17:"Nuevo Notepad++ Document.txt",18:"Script AutoIt.au3",19:"Script Autohotkey.ahk", 20:"es un trial de prueba.txt", 21:"ae.fecha.txt",22:"File22.txt", 23:"File23.txt", 24:"File24.txt",25:"File25.txt",26:"File26.txt"}
  13.         LV_Add("",B)
  14.         Gui, Add, Button, gChoose, Submit
  15.       Gui, Show, h340 w420, Choose File Name
  16.       Return
  17.     }
  18.      
  19.     Choose:
  20.    ControlGet, List, List, Selected, SysListView321, ahk_id %HWND%
  21.     Gui, Destroy
  22.     Loop, Parse, List, `n
  23.     {
  24.        If !FileExist(DesPath "\" A_LoopField)
  25.           FileAppend,, %DesPath%\%A_LoopField%
  26.     }
  27.     Return

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Adapt emptytxtfile.ahk to windows 8.1
« Reply #38 on: August 15, 2015, 08:33 AM »
parsed it to remove the Address: prefix, and 'et voila', working

I forgot about that.  I had to do the same thing in FolderCache for Vista and later.  I think I used StringBetween() to get the string after "Adress:" up to the end of line.

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: Adapt emptytxtfile.ahk to windows 8.1
« Reply #39 on: August 16, 2015, 08:36 AM »
At the present moment i have problems with Microsoft as usual.
All my attempts to go to windows 10 fails until the moment under different messages . Like error 80007003 and others.
After try all the usual solutions i have arrived to the microsoft forums and waiting.

 :-[

But i can try the new code in windows 8.1 right now and comment

Best Regards
 :P

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: Adapt emptytxtfile.ahk to windows 8.1
« Reply #40 on: August 16, 2015, 08:39 AM »
It is WORKINGGGGGGGGG !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 :Thmbsup: :Thmbsup: :Thmbsup: :Thmbsup: :Thmbsup: :Thmbsup: :Thmbsup: :Thmbsup: :Thmbsup: :Thmbsup: :Thmbsup: :Thmbsup:

Nice Work Ath

Best Regards