AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Retrieve full pathname of document opened in Notepad

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
a_h_k



Joined: 02 Feb 2008
Posts: 344

PostPosted: Sun Nov 22, 2009 4:36 pm    Post subject: Retrieve full pathname of document opened in Notepad Reply with quote

I need this so that i can know if the file opened is an .ahk or not

* My file extensions = hidden in Explorer options (so dont show in Notepad titlebar)
Back to top
View user's profile Send private message
i3egohan



Joined: 18 Jul 2006
Posts: 401

PostPosted: Sun Nov 22, 2009 4:54 pm    Post subject: Reply with quote

Get the notepad title.. Then append .ahk to end of it..

Then use IfFileExist..

NotePadTitle .= .ahk
Back to top
View user's profile Send private message
a_h_k



Joined: 02 Feb 2008
Posts: 344

PostPosted: Sun Nov 22, 2009 5:10 pm    Post subject: Reply with quote

Actually it's a little more involved than i implied..

--> I do not know the wherabouts of the file opened (ie explorer is not opened at that location - is just Notepad window & no explorer window)
Back to top
View user's profile Send private message
i3egohan



Joined: 18 Jul 2006
Posts: 401

PostPosted: Sun Nov 22, 2009 5:24 pm    Post subject: Reply with quote

if the AHK file has a GUI, you could use ControlGet to deterime if its a ahk program/script or not.

There are numerous ways using ahk_class etc.. You tried these?

Or maybe im still not understanding
Back to top
View user's profile Send private message
a_h_k



Joined: 02 Feb 2008
Posts: 344

PostPosted: Sun Nov 22, 2009 5:34 pm    Post subject: Reply with quote

i3egohan wrote:
if the AHK file has a GUI, you could use ControlGet to deterime if its a ahk program/script or not
No, no Gui is running, am just editing the script

Am currently searching for a 3rd-party command-line tool which will provide this info (but which quite probably doesnt exist)
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 7159

PostPosted: Sun Nov 22, 2009 7:57 pm    Post subject: Reply with quote

Please search the forum for getremotecommandline
Back to top
View user's profile Send private message
a_h_k



Joined: 02 Feb 2008
Posts: 344

PostPosted: Mon Nov 23, 2009 2:03 am    Post subject: Reply with quote

Brilliant!! Thanks for that SKAN !! Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group