ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

Create an empty txt file in the active window

<< < (2/5) > >>

Contro:
Wonderful indeed. I promised try and comment.
Now I have a piece of code from AHK and need something else. But that is another post.

Thanks everyone.
Miles I am enjoying every day ReOpen.
Best Regards

MilesAhead:
Miles I am enjoying every day ReOpen.
Best Regards

-Contro (June 16, 2012, 05:43 PM)
--- End quote ---

Thanks. Glad you like it. :)

MilesAhead:
Another approach that may work a bit more reliably uses clipboard in a folder. It uses the same Send key technique for desktop.  But inside a folder, select one folder with the mouse and hit the hotkey. It should only try to create instructions.txt if the highlighted item is a folder. Since that creates the file inside the folder, I use Run to launch it. Might save opening the selected folder and hunting for the file. Since it uses FileAppend function, if the file already exists in the folder, it should open it. You can spiff up the code a bit by doing stuff like saving clipboard contents and restoring etc... This is just a working skeleton.



--- ---#SingleInstance force
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%

GroupAdd,DeskGroup,ahk_class CabinetWClass
GroupAdd,DeskGroup,ahk_class ExploreWClass
GroupAdd,DeskGroup,ahk_class Progman
GroupAdd,DeskGroup,ahk_class WorkerW

#IfWinActive ahk_group DeskGroup
^+F10::
  WinGetClass,class,A
  if (class = "Progman") or (class = "WorkerW")
  {
    Send {AppsKey}wt
    Sleep,10
    Send instructions
  }
  else if (class = "CabinetWClass") Or (class = "ExploreWClass")
  {
    Clipboard=
    Send ^c
    ClipWait,2
    ff = %Clipboard%
    if (!InStr(FileExist(ff),"D"))
      SoundPlay, *16
    else
    {
      ff := ff "\instructions.txt"
      FileAppend,,%ff%
      Run,%ff%
    }
  }
  _EmptyWorkingSet()
return

_EmptyWorkingSet()
{
  return DllCall("psapi.dll\EmptyWorkingSet", "UInt", -1)
}


Contro:
Here is an AutoHotkey script that will do what you ask (attached is an compiled EXE as well). You can change the hotkey by editing the script. Right now it is set to Win+N (#n in the script). This works on my Windows 7 system. Not sure about others, you'll have to test it out. Hope this helps.


--- ---;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:         Chris Gingerich
;
; Script Function:
; Template script (you can customize this template by editing "ShellNew\Template.ahk" in

your Windows folder)
;

; Creates a new textfile in the current folder if an explorer window is active.

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

#n::
IfWinActive,ahk_class CabinetWClass
{
  Send !fwt
}-c.gingerich (June 16, 2012, 03:15 PM)
--- End quote ---

 :-* :-\
I am trying to understand the hotkey. I have to study AHK of course.

I'll come back and comment.
 :)

Contro:
 ;D
Seen

Win+n

By the way. I am studying your web and seems you have a reward soft perhaps similar to Points Motivator from Mouser. I will take a good look. It's very interesting.

Best Regards

the script is residente. I am creating instructions.txt files only when I am downloading wonderful software to document the installation. it's not all time, so I would prefer one icon less in the tray icon.
I have hidden someones, but I have a lot and sometimes problems of memory

 :P


Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version