topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Saturday May 28, 2022, 12:20 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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - skrommel [ switch to compact view ]

Pages: prev1 [2] 3 4 5 6 7 ... 38next
26
Uploaded the sourcecode. So your displays disconnect when they go to sleep, and not when the PC sleeps? That could possibly be detected in the program by watching the mouse and keyboard inactivity?

27
 :) WinPosSaver saves the window positions every minute, and restores the layout after sleep or hibernation.

WinPosSaver.gif

You can quickly test it by using Save layout and Load layout from the menu.

This is the first draft, so please report errors. I have plenty of ideas for it, like saving and loading multiple layouts, option to automatically restart the programs when loading layouts, detecting when monitors are added and removed...

26.07.2017: Added monitor sleep detection. Also logs power changes to Log.txt

Skrommel

28
Post New Requests Here / Re: Manipulate lines in a txt file
« on: July 25, 2017, 02:13 PM »
 :) How about this one?

Fill inn source and target and save the script as Parts.ahk. Download and install Autohotkey to run the script.

Skrommel

source=Source.txt
target=Target.txt

#NoEnv
#SingleInstance,Force
SetBatchLines,-1

string:=""
FileRead,lines,%source%
Loop,Parse,lines,`n                                ; Split by line break
{
  StringSplit,part_,A_LoopField,.                  ; Split by period
  If part_0<3                                      ; 1 part
    line:=A_LoopField
  Else
    StringReplace,line,A_LoopField,%part_1%.,      ; Remove part 1
  line=%line%                                      ; Remove trailing space
  string.=line "`n"                                ; Add line break
}
FileDelete,%target%
FileAppend,%string%,%target%

29
Uploaded the script, orbis.

30
Could it be the tooltip? What game are you running?

:) Yes! It was the tooltip. Try the latest version.

31
It must be the volume mixer starting... Try the updated version. It keeps SndVol.exe running, and I added a menu option to show the volume mixer. And an option to change the hotkey.

32
Maybe the latest version is better? It minimizes the volume mixer window.

I've tried it with YouTube in full screen, and that works OK. What programs are you having problems with?

33
 :) AppMute toggles the sound of the active app when F1 is pressed. If the desktop or taskbar is active, all sound is toggled.

AppMute.jpg

It's a very quick hack, it uses the volume mixer in Windows 10.

Save the script as AppMute.ahk.
Download and Install AutoHotkey to run the script.

Skrommel

24.07.2017: Keeps SndVol.exe running to prevent fullscreen windows from restoring. Added menu option to show the volume mixer.
24.07.2017: Added user defined hotkey option.
25.07.2017: Removed the tooltip to prevent fullscreen windows from restoring.
30.07.2017: Changed the way SndVol.exe is handled, to stop it from showing up in Win7.

34
 :) I downloaded and converted SmileAlways from the Chrome store, and it works in Edge!

SmileAlways.jpg

But it is unsigned, with all the hassels of warnings and manual installation, so publishing in the Windows Store is the way to go.

35
:) That's a bit outside my field of expertise. It would be simple enough to change the address bar, but addons are made using MS Visual Studio...

So you want the extension available on the Microsoft Store, and running in both Internet Explorer and Edge?

36
 :) a.smile is a simple script to replace urls in Internet Eplorers address bar to change www.amazon.com to smile.amazon.com to support charity.

ASmile.gif

Skrommel

37
Post New Requests Here / Re: Auto print Email Attachment
« on: July 22, 2017, 07:10 PM »
 :) PrintMail is a wrapper for getmail.exe from http://www.interlog....charron/getmail.html.

Just add your user information, save the file as PrintMail.ahk in a folder, download and place getmail.exe beside it, and it will extract and print the attachments, and move the files to the Printed folder.
Download and install AutoHotkey to run the script.

Skrommel

23.07.2017: Added option to set target printer

;PrintMail.ahk
;  Print mail attachments, uses getmail.exe from http://www.interlog.com/~tcharron/getmail.html
;Skrommel @ 2017

target=Printed
popserver=
port=110
username=
password=
pause=60
deletefromserver=0
printer=

#NoEnv
#SingleInstance,Force
SetWorkingDir,%A_ScriptDir%

If deletefromserver=1
  delete=-delete
If printer<>
  printer=/d "%printer%

FileCreateDir,%target%
Loop
{
  RunWait,cmd /c getmail.exe -u %username% -pw %password% -s %popserver% -port %port% %delete% -xtract,,Hide
  FileMove,MSG*.txt,%target%
  Loop,*.*
  {
    If A_LoopFileName In PrintMail.ahk,PrintMail.exe,getmail.exe
      Continue
    RunWait,print %printer% "%A_LoopFileName%"
    FileMove,%A_LoopFileName%,%target%
  }
  Sleep,% 1000*pause
}

38
 :) Added a master volume control, orbis, I'll see if I can add a more targeted volume solution. Also, I found the error in the hourly files code, nogojoe, and I added a checkbox to choose between the play options.

39
Coding Snacks / Re: Connect by command
« on: July 19, 2017, 11:19 AM »
Yes, it is possible. :) You can save and load Wifi-profiles using netsh.

https://community.sp...-on-windows-machines

40
Finished Programs / Re: DONE: MultiMonitorManager
« on: July 18, 2017, 03:13 PM »
:) Just uploaded a version of MultiMonMan running on Windows 10!

41
:) Added an option to play sound files 0.wav, 1.wav... 23.wav on the hour if they exist in the program's folder, mouser.

Or just 0 through 12, it checks if files >12 exists, and if not it chooses the earlier ones.

42
:) Added an option to play the sound multiple times on the hour, nogojoe.

I could maybe add a second sound file to make the clock sound reverb on the last chime. Or maybe 12 separate files?

Skrommel

43
:) Made just for you, stisev!

It's was a quick hack, so I forgot to put code in the browse button! Updated the code on top. I also uploaded an .exe-file.

Skrommel

44
ClosedBy could easily be modified to watch if a file's size has stopped changing. :)

Or maybe you are referring to the CPU activity of the process? Or network activity?

Skrommel

https://www.donationcoder.com/forum/index.php?topic=43907.new

45
ClosedBy closes a program when a file contains a word. :)

ClosedBy.jpg

Download and install AutoHotkey to run the script.
Save the script to ClosedBy.ahk and doubleclick to run.

10.07.2017: Added a timeout. Corrected a bug when selecting a file to watch.

Skrommel

;ClosedBy.ahk
; Closes a program when a file contains a word
;Skrommel @ 2017

#NoEnv
#SingleInstance,Force

Gosub,INILOAD
Gosub,GUI
Return


GUI:
;Menu,Tray,NoStandard
Menu,Tray,Add,&ClosedBy,SHOW
Menu,Tray,Add
Menu,Tray,Add,&Show...,SHOW
Menu,Tray,Add,E&xit,EXIT
Menu,Tray,Default,&ClosedBy
Menu,Tray,Tip,ClosedBy

Gui,1:Add,Text,,Program to close:
Gui,1:Add,Edit,XM Y+2 W300 Vprogram,% program
Gui,1:Add,Button,X+5 W50 GPROGRAM,&Browse
Gui,1:Add,Text,XM,File to search:
Gui,1:Add,Edit,XM Y+2 W300 Vfile,% file
Gui,1:Add,Button,X+5 W50 GFILE,&Browse
Gui,1:Add,Text,XM,Word to look for:
Gui,1:Add,Edit,XM Y+2 W300 Vword,% word
Gui,1:Add,Text,XM,Delay between searches:
Gui,1:Add,Edit,XM Y+2 W50 Vdelay Limit4,% delay
Gui,1:Add,UpDown,Range1-9999
Gui,1:Add,Text,X+5 W150,seconds
GuiControl,1:,delay,% delay
Gui,1:Add,Text,XM,Timeout before closing program:
Gui,1:Add,Edit,XM Y+2 W50 Vtimeout Limit4,% delay
Gui,1:Add,UpDown,Range1-9999
Gui,1:Add,Text,X+5 W150,seconds
GuiControl,1:,timeout,% timeout
Gui,1:Add,Button,X+100 W50 GRUN +Default,&Run
Gui,1:Add,StatusBar,GWEBPAGE,1HourSoftware.no
SB_SetIcon("1HourSoftware.ico")
Gui,1:Show,,ClosedBy

Gui,2:+AlwaysOnTop
Gui,2:Add,Progress,XM W300 Vcountdown Range0-%timeout%,% timeout
Gui,2:Add,Button,XM W100 +Default GCLOSE,&Close the program
Gui,2:Add,Button,X+5 W50 GABORT,&Abort
Return


RUN:
Gui,Submit
Gosub,INISAVE
Loop
{
  abort=0
  close=0
  Process,Exist,%program%
  If ErrorLevel>0
  {
    FileRead,lines,% file
    IfInString,lines,% word
    {
      Gui,2:Show,NoActivate,ClosedBy
      countdown:=timeout
      Loop,% timeout
      {
        If close=1
          Break
        GuiControl,2:,countdown,% countdown
        countdown-=1
        Sleep,1000
      }
      If abort=1
        Continue
      Process,Close,% program
      Gui,2:Hide
    }
  }
  Sleep,% delay*1000
}
Return


CLOSE:
close=1
Gui,2:Hide
Return


ABORT:
abort=1
Gui,2:Hide
Return


PROGRAM:
Gui,1:Submit,NoHide
FileSelectFile,program,3,% program,Select a program,Programs (*.exe)
IfExist,% program
{
  SplitPath,program,program
  GuiControl,1:,program,% program
}
Return


FILE:
Gui,1:Submit,NoHide
FileSelectFile,file,3,% file,Select a text file,Text files (*.txt)
IfExist,% file
  GuiControl,1:,file,% file
Return


SHOW:
Gui,1:Show
Return


INILOAD:
IniRead,program,ClosedBy.ini,Settings,program
IniRead,file,ClosedBy.ini,Settings,file
IniRead,word,ClosedBy.ini,Settings,word
IniRead,delay,ClosedBy.ini,Settings,delay
IniRead,timeout,ClosedBy.ini,Settings,timeout
If program=ERROR
  program=Calc.exe
If file=ERROR
  file=C:\Output.txt
If word=ERROR
  word=FINISHED
If delay=ERROR
  delay=10
If timeout=ERROR
  timeout=30
Return


INISAVE:
IniWrite,% program,ClosedBy.ini,Settings,program
IniWrite,% file,ClosedBy.ini,Settings,file
IniWrite,% word,ClosedBy.ini,Settings,word
IniWrite,% delay,ClosedBy.ini,Settings,delay
IniWrite,% timeout,ClosedBy.ini,Settings,timeout
Return


WEBPAGE:
Run,http://www.1HourSoftware.no,,UseErrorLevel
Return


GuiClose:
EXIT:
Gosub,INISAVE
ExitApp

46
:) Chime plays a sound file or tells the time on the hour and every x minutes.

Chime.jpg

Chime is portable, it saves it's settings to Chime.ini, just copy the file to the folder you put the script in on your other computers.

Download and install AutoHotkey to run the script.
Save the script as Chime.ahk and doubleclick to run.

17.07.2017: Added code to the Browse button. @stisev
18.07.2017: Added option to chime multiple times on the hour. @nogojoe
18.07.2017: The program checks for files 0.wav, 1. wav... 23.wav to be played on the hour. @mouser
21.07.2017: Added volume bar. @orbis. Removed a bug affecting playing individual hour files. @nogojoe
16.08.2017: Changed timing
21.10.2017: Added checkbox to ignore the volume

Skrommel

47
SortMoviesByGenre creates links to movies, placing them in folders of genre, based on parts of their filename. :)

SortMoviesByGenre.jpg

I'm not sure how standardized your foldernames are. I added an option to separate the title and genre from the rest of the folder name by a user defines text, but maybe separating by genre would be better? I could add all the IMDB genres to the file, and use that to split the folder names.

Download and install AutoHotkey to run the script.
Save the script to a text file called SortMoviesByGenre.ahk and double click to run.

Skrommel

Code: Autohotkey [Select]
  1. ;SortMoviesByGenre.ahk
  2. ; Create links to movies, placing them in folders of genre, based on parts of their filename
  3. ;Skrommel @2017
  4.  
  5.  
  6. IniRead,moviefolder,SortMoviesByGenre.ini,Settings,moviefolder
  7. IniRead,sortedfolder,SortMoviesByGenre.ini,Settings,sortedfolder
  8. IniRead,separator,SortMoviesByGenre.ini,Settings,separator
  9. If moviefolder=ERROR
  10.   moviefolder=C:\Movies
  11. If sortedfolder=ERROR
  12.   sortedfolder=C:\Sorted
  13. If separator=ERROR
  14.   separator=.DVD,.CAM,.XVID
  15.  
  16. Gui,Add,Text,xm,Folder with movies
  17. Gui,Add,Edit,xm w300 vmoviefolder,% moviefolder
  18. Gui,Add,Button,x+5 w50 GBROWSEMOVIE,&Browse
  19. Gui,Add,Text,xm,Folder to put links sorted by genre into
  20. Gui,Add,Edit,xm w300 vsortedfolder,% sortedfolder
  21. Gui,Add,Button,x+5 w50 GBROWSESORTED,B&rowse
  22. Gui,Add,Text,xm,Text separating title and genre from the rest of the name.`nUse , between separators
  23. Gui,Add,Edit,xm w300 vseparator,% separator
  24. Gui,Add,Button,xm w50 GSORT +Default,&Sort
  25. Gui,Add,StatusBar,,Skrommel @ 2017
  26. Gui,Show,,SortMoviesByGenre
  27. Return
  28.  
  29.  
  30. BROWSEMOVIE:
  31. {
  32.   FileSelectFolder,newmoviefolder,% "*" moviefolder,3,Select folder with movies
  33.   If ErrorLevel=1
  34.     Return
  35.   IfExist,% newmoviefolder
  36.     Break
  37.   MsgBox,% "The movie folder could not be found!"
  38. }
  39. GuiControl,,moviefolder,% newmoviefolder
  40. Return
  41.  
  42.  
  43. BROWSESORTED:
  44. {
  45.   FileSelectFolder,newsortedfolder,% "*" sortedfolder,3,Select folder with movies
  46.   If ErrorLevel=1
  47.     Return
  48.   IfExist,% newsortedfolder
  49.     Break
  50.   MsgBox,% "The sorted folder could not be found!"
  51. }
  52. GuiControl,,sortedfolder,% newsortedfolder
  53. Return
  54.  
  55.  
  56. Gui,Submit,NoHide
  57. IfNotExist,% moviefolder
  58. {
  59.   MsgBox,% "The movie folder could not be found!"
  60.   Return
  61. }
  62.  
  63. IniWrite,% moviefolder,SortMoviesByGenre.ini,Settings,moviefolder
  64. IniWrite,% sortedfolder,SortMoviesByGenre.ini,Settings,sortedfolder
  65. IniWrite,% separator,SortMoviesByGenre.ini,Settings,separator
  66.  
  67. SB_SetText("Sorting moivies into " sortedfolder "...")
  68. Loop,% moviefolder "\*.*",2,0
  69. {
  70.   first=999                                           ;Extract title and genre
  71.   Loop,Parse,separator,`,
  72.   {
  73.     If (pos>0 And pos<first)
  74.       first:=pos
  75.   }
  76.   StringLeft,titlegenre,A_LoopFileName,% first
  77.  
  78.   StringSplit,part_,titlegenre,`.                     ;Extract genre
  79.   genre:=part_%part_0%
  80.  
  81.   title=                                              ;Extract title
  82.   Loop,% part_0-1
  83.     title:=title part_%A_Index% " "
  84.   title=% title
  85.  
  86.   FileCreateDir,% sortedfolder "\" genre                ;Create link
  87.   FileCreateShortcut,% A_LoopFileLongPath,% sortedfolder "\" genre "\" title ".lnk"
  88. }
  89. SB_SetText("Finished sorting movies into " sortedfolder)
  90. Return
  91.  
  92.  

48
Skrommel's Software / Re: MoveOut: License? I want to extend it
« on: April 25, 2015, 03:16 PM »
Feel free, danielo515! :)

Skrommel

49
Happy anniversary, mouser! :)

I'm late to join this thread, and I must have been late joining DoncationCoder, too, 'cause no way it's been 10 years!  :tellme:

DonationCoder was my 40 year crisis, 8) together with buying a piano, and I must say it was a fun time, completing a Coding Snack just about every other night! I still have the DonationCredits, but I'll probably bankrupt DonationCoder if I withdraw them? :o

But three kids and a wife soon took their fair share of attention, :-* and now I run my little five man computer firm, selling computers, hosting servers, developing web pages and of course programming helpful tools for local businesses, so I still use AutoHotkey pretty much every day!  :Thmbsup:

In the evenings I run the town news web page, and dream of finding the time to complete my groundbreaking software project and retire at 50! :)

So thank you DonationCoder, for all the praise, and for giving my life direction!

I'll be back full time when that retirement is secured, mouser! :P

Skrommel

50
Try PDF Creator in combination with Coherent PDF!  :)

http://www.pdfforge.org/pdfcreator
http://community.coherentpdf.com

PDF Creator installs a printer. Anything printed to it creates a PDF file, and the process of saving, stamping and finally printing to a real printer can be automated! Use Coherent PDF to add text to every page.

To make it work I also had to use AutoHotkey, PDF Creator wouldn't send the proper variables to Coherent PDF.

http://www.autohotkey.com

Install all three tools, save the script below as Stamp.ahk and pont to it in PDF Creator's Actions - Run script. Also configure Auto-Save and Actions - Print Document and you'll be datestamping every page you print in no time!

;Stamp.ahk
; Adds timestamp to the the top of every page of a PDF file
;Skrommel @ 2014

RunWait,cpdf.exe -topleft 10 -font Courier -add-text "%A_Now%" "%1%" -o "%1%"

Pages: prev1 [2] 3 4 5 6 7 ... 38next