topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Thursday April 18, 2024, 10:53 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 - BigVent [ switch to compact view ]

Pages: [1] 2next
1
Post New Requests Here / Re: IDEA: AutoMaximize Windows
« on: April 24, 2015, 09:27 AM »
Give this a shot & see what it does for you.


Code: Autohotkey [Select]
  1. ;http://www.autohotkey.com/board/topic/19672-detect-when-a-new-window-is-opened/
  2. ;DLLCall / Shell / MsgBox = SKAN
  3.  
  4. ;-------------------------------------------------------------------
  5. ;--Program monitors newly opened windows & maximizes accordingly--
  6. ;-------------------------------------------------------------------
  7.  
  8. SetWorkingDir %A_ScriptDir%
  9. onexit, exitsub
  10.  
  11. Gui +LastFound
  12. hWnd := WinExist()
  13.  
  14. DllCall( "RegisterShellHookWindow", UInt,hWnd )
  15. MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )
  16. OnMessage( MsgNum, "ShellMessage" )
  17. Return
  18.  
  19. ShellMessage( wParam,lParam )
  20. {
  21.   Local k
  22.   If ( wParam = 1 ) ;  HSHELL_WINDOWCREATED := 1
  23.   {
  24.        NewID := lParam
  25.        SetTimer, MsgBox, -1
  26.   }
  27. }
  28.  
  29.          WinGetTitle, Title, ahk_id %NewID%
  30.          WinGetClass, Class, ahk_id %NewID%
  31.          WinWait, ahk_id %NewID%
  32.                                
  33.         ;add items you do NOT want maximized here... e.g. Properties Window (Alt+Enter), WinRar, etc.
  34.         ;*Note: WinTitles need to be case sensitive
  35.         if InStr(Title, "Properties") || InStr(Title, "WinRar")
  36.                 return
  37.         else
  38.                 minmax_func()
  39. Return
  40.  
  41. ralt & Esc::    ;right Alt key & Esc
  42. exitsub:
  43. {
  44.     critical
  45.         Exitapp
  46. }
  47.  
  48. ;=================
  49. ;==Function(s)====
  50. ;=================
  51. minmax_func()
  52. {
  53.         global NewID, minmax
  54.         WinGet, minmax, minmax, ahk_id %NewID%
  55.  
  56.    if (minmax=0)
  57.    {
  58.       WinMaximize, ahk_id %NewID%
  59.           ;use PostMessage for stubborn windows
  60.           ;PostMessage, 0x112, 0xF030,,, NewID  ; 0x112 = WM_SYSCOMMAND, 0xF030 = SC_MAXIMIZE
  61.    }
  62.    else
  63.         if (minmax=-1)
  64.         {
  65.                 WinRestore, ahk_id %NewID%
  66.         }
  67. }

2
My apologies for not placing a link sooner.

Very old topic (I know) but just in case a solution was never found:

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

3
Here's a very quick example of what you needed.

Notes:
  • Timer is set to fire after 45 minutes of idle time (adjust as needed)
  • Should the program then exit after it fires? (I'm not sure how often you needed notices so I'll leave that up to you)
  • Easy email send via COM - adjust your email & credentials


Enjoy!

Code: Autohotkey [Select]
  1.  
  2. time := 2700000 ;//45 minutes
  3.  
  4. SetTimer, check, 300000 ;//check once every 5 min
  5. return
  6.  
  7. check:
  8.         if(A_TimeIdle >= time)
  9.         {
  10.                 email()
  11.                 SetTimer, check, off
  12.         }
  13. return
  14.  
  15. ;//function email
  16. email()
  17. {
  18.         pmsg                    := ComObjCreate("CDO.Message")
  19.         pmsg.From               := "[email protected]"
  20.         pmsg.To                 := "[email protected]"
  21.         pmsg.BCC                := ""   ; Blind Carbon Copy, Invisable for all, same syntax as CC
  22.         pmsg.CC                 := ""
  23.         pmsg.Subject    := "PC in question is idle"
  24.  
  25.         ;You can use either Text or HTML body like
  26.         pmsg.TextBody   := A_Username " 's PC is idle."
  27.         ;OR
  28.         ;pmsg.HtmlBody := "<html><head><title>Hello</title></head><body><h2>Hello</h2><p>Testing!</p></body></html>"
  29.  
  30.         ;var := A_ScriptDir
  31.         ;msgbox % var
  32.         ;"%SPVvar%"|"%VPNvar%"
  33.         ;SPVvar := A_ScriptDir "\blah.txt"
  34.         ;VPNvar := A_ScriptDir "\blah1.txt"
  35.  
  36.         sAttach                 = ;%SPVvar%|%VPNvar%
  37.  
  38.  
  39.                 ; can add multiple attachments, the delimiter is |
  40.  
  41.         fields := Object()
  42.         fields.smtpserver   := "smtp.gmail.com" ; specify your SMTP server
  43.         fields.smtpserverport     := 465 ; 25
  44.         fields.smtpusessl      := True ; False
  45.         fields.sendusing     := 2   ; cdoSendUsingPort
  46.         fields.smtpauthenticate     := 1   ; cdoBasic
  47.         fields.sendusername := "[email protected]"
  48.         fields.sendpassword := "password12345"
  49.         fields.smtpconnectiontimeout := 60
  50.         schema := "http://schemas.microsoft.com/cdo/configuration/"
  51.  
  52.         pfld :=   pmsg.Configuration.Fields
  53.  
  54.         For field,value in fields
  55.                 pfld.Item(schema . field) := value
  56.         pfld.Update()
  57.  
  58.         Loop, Parse, sAttach, |, %A_Space%%A_Tab%
  59.           pmsg.AddAttachment(A_LoopField)
  60.          
  61.         pmsg.Send()
  62.         return
  63. }
  64.  
  65. esc::
  66.         critical
  67.         exitapp
  68. return

4
Can you provide a test vcf to use?  It'd be helpful to see one in action (change the names ofc)

5
N.A.N.Y. 2014 / Re: N.A.N.Y 2014 Submission: FTP File Uploader
« on: January 21, 2014, 10:26 AM »
Here's an updated exe. (above)

"Though I liked the concept of putting the files on to a file and uploading them, however it would had been better if there was an option to mention the FTP server’s address, username and password so the repeated task of typing in the details could be avoided." - Shine

Implemented & added the suggestion.  I agree that it would help the user especially if you're only using the same ftp.



Enjoy!

6
N.A.N.Y. 2014 / Re: N.A.N.Y 2014 Submission: FTP File Uploader
« on: January 17, 2014, 04:06 PM »
Very cool that this got reviewed & could help someone out.  Thank you for the notice!

Sorry for the delay kyrathaba, nothing at the moment works besides cURL. 

7
Either way gentlemen... Thank you for the banter.

MilesAhead - thanks for being a good sport. The tools you suggested are great. I downloaded & agree.

Tao - I scan everything to a single file... But that's just me. Handle it all at once & done.

We're just geeks plain and simple. All ways work.  :Thmbsup:

OP: if you're still reading... Find the way you prefer & roll with it.

There are many many ways to take care of what you need.


8
 :huh:

"Why would you jump to that conclusion?  He says he scanned a thousand songs.  I'd say it was a safer assumption that he has 1000 files." - MilesAhead

"I'm creating a hymn book. The book I scanned and OCR'd had all the songs as blocks, with capitals only at the beginning of a sentence." - OP

He didn't say I scanned *several* books... but "THE BOOK".  Ergo, my assumption.  I could ask why you thought he had thousands of items and call you out on the boards for poorly reading what he wrote... but frankly I don't care.


It's good to have for cases where an already debugged one-liner may save you a ton of work.

That's awesome!  Perhaps I learned something from my 15 minutes of work on this script.   8)

9
Notes:
  • We can only assume that the OP has one single file.
  • I ran this new script on a 105,400 line txt file.  It returned in 1800 ms. (txt file is 6525 KB)
  • Fixed leading white spaces... under the assumption that the OP had leading white spaces on lines.
  • Target's method used is a little faster. Since it's a "once and done" project either method should suffice.

Anyway, Good Luck stormproof!

Code: Autohotkey [Select]
  1. SetWorkingDir %A_ScriptDir%
  2.  
  3. ;// OP -> "The book I scanned and OCR'd had all the songs as blocks, with capitals only at the beginning of a sentence."
  4. ;// We can only assume it's ONE single file
  5. FileSelectFile, SelectedFile, 3, , Open a file, Text Documents (*.txt; *.doc)
  6. if SelectedFile =
  7. {
  8.     MsgBox, You didn't select a file.
  9.                 exitapp
  10. }
  11. else
  12. {
  13.         FileRead, orig_str, %SelectedFile%
  14.         loop, parse, orig_str, `n, `r
  15.         {
  16.                 if (A_LoopField != "")
  17.                 {
  18.                         word_array := StrSplit(A_LoopField, A_Space)
  19.                        
  20.                         ;// fixed leading whitespace but is ONLY an assumption that one exists
  21.                         ;// IF there's not a white space
  22.                         if (word_array[1] != "")
  23.                         {
  24.                                 str := word_array[1]
  25.                                 StringUpper,str,str,T
  26.                                 word_array[1] := str
  27.                         }
  28.                         else
  29.                         {
  30.                                 str := word_array[2]
  31.                                 StringUpper,str,str,T
  32.                                 word_array[2] := str
  33.                         }
  34.                        
  35.                         ;// Rebuild the string and append to temp_var
  36.                         loop % word_array.MaxIndex()
  37.                         {
  38.                                 if (word_array[a_index] = "")
  39.                                         continue
  40.                                 temp_var .= word_array[a_index] " "
  41.                         }
  42.                         temp_var .= "`n"
  43.                 }
  44.         }
  45. }
  46.  
  47. IfExist, Output_File.txt
  48.         FileDelete, Output_File.txt
  49. FileAppend, %temp_var%, Output_File.txt
  50.  
  51. Run, Output_File.txt
  52.        
  53. esc::
  54.         critical
  55.         exitapp
  56. return

10
 Modify as needed.  :Thmbsup:

HTH's


Code: Autohotkey [Select]
  1.  
  2. ;//replace this string with your fileread, string, ...
  3. ;//FileRead, orig_str, C:\My Documents\My File.txt  ;//<== if this is used then the "join" just below this needs to be deleted
  4. ;//*from here*
  5. orig_str=
  6. (
  7. i'm creating a hymn book.  The book I scanned and OCR'd had all the songs as blocks, with capitals only at the beginning of a sentence.
  8. whereas I want to put a capital at the start of every line.
  9.  
  10. there are just under a thousand songs so I don't want to do it by hand!!
  11.  
  12. any ideas?  I've looked on line and can't find anything except via MS Word, which can be configured to do it after every carriage return.
  13. but as far as I can see, only as you type.
  14.  
  15. is there a way to replace every "carriage return" with "carriage return and capitalise the next letter"?
  16. )
  17. ;//*To here*
  18.  
  19. msgbox, Original text used:`n`n`n%orig_str%
  20.  
  21. loop, parse, orig_str, `n, `r
  22. {
  23.         if (A_LoopField != "")
  24.         {
  25.                 word_array := StrSplit(A_LoopField, A_Space)
  26.                                        
  27.                 str := word_array[1]
  28.                 StringUpper,str,str,T
  29.                                
  30.                 word_array[1] := str
  31.                
  32.                 loop % word_array.MaxIndex()
  33.                 {
  34.                         temp_var .= word_array[a_index] " "
  35.                 }
  36.                 temp_var .= "`n`n"
  37.         }
  38. }
  39.  
  40. msgbox, Final Result:`n`n`n%temp_var%
  41.  
  42. esc::

11
N.A.N.Y. 2014 / N.A.N.Y 2014 Submission: FTP File Uploader
« on: November 27, 2013, 10:37 AM »
NANY 2014 Entry Information


Application NameFTP File Uploader
Version1.0
Supported OSesWin XP or greater
Web pageNone
Download linkhttp://www.datafilehost.com/d/4c754c9a
System RequirementsWin XP or greater
AuthorBigVent

  • Idea obtained from: this post
  • This program will parse a selected text file & then upload those file names within said folder.
  • EXE must be in the folder of the images to be PUT via FTP.
  • Uses cURL for the PUT
  • Clears variables at the end so that nothing is stored
  • ESC key is the exitapp hotkey

Typical txt file: (only file_names & ext)

1.JPG
2.JPG
3.JPG

Download link:

http://www.datafilehost.com/d/9e50c56a

New Link:
http://www.datafilehost.com/d/4c754c9a


12
Living Room / Great sites for guitar learning
« on: November 26, 2013, 09:37 AM »
The purpose of this thread is to share links that would help *everyone* get a jump-start on the learning curve.

Please post your favorite sites, links, etc to help the community.

Thanks!


Justin Guitar -- Great site overall from beginners to advanced guitar

tropicalmba  -- Great site for beginners to start




13
Post New Requests Here / Re: comma remover and name order changer
« on: October 24, 2013, 12:09 PM »
Assuming all your file_names have "Lastname, Firstname Middle_init.ext" this should work for your purposes.  However, it WILL NOT work if they do not have a middle initial.  I based this upon your example above... "Abbott, John B.jpg"

Here's an easy example of what you need.  I know that this can be done via RegEx & other various ways, but I wanted to keep it simple. 
I felt it was easier to understand if you modified the code yourself. 

Feel free use as needed.

Enjoy!

Code: Autohotkey [Select]
  1.  
  2. FileSelectFolder, WhichFolder  ; Ask the user to pick a folder.
  3. Loop, %WhichFolder%\*.*, , 1
  4. {
  5.         file_name := A_LoopFileName
  6.  
  7.         StringReplace, file_name, file_name, `, , ,All    ;//removes the commas
  8.         StringReplace, file_name, file_name, ., %A_Space%, All     ;//changes the period to space
  9.        
  10.         name_array := StrSplit(file_name, A_Space)   ;//break it apart using the spaces & put into array
  11.        
  12.         final_name := name_array[2] " " name_array[3] " " name_array[1] "." name_array[4]    ;//combine array to new file struct
  13.        
  14.         FileMove, %WhichFolder%\%A_LoopfileName%, %WhichFolder%\%final_name%  ;//renames a single file
  15. }
  16.  
  17. msgbox, File Name(s) have been changed!
  18.  
  19.  
  20. Esc::   ;//panic button
  21.         critical

14
Count me in for one too.

15
Perhaps I should've clarified that this was an example that can be modified to suit your needs & I only tested it on my XP box, sorry about that.
Anyway, I've made an adjustment to the window & it should work as desired.  (e.g. "Date and Time Properties" on XP & "Date and Time" on > Vista)

Tested on Win XP, Vista, & 7


Enjoy!

Code: Autohotkey [Select]
  1.        
  2.     ;//change hotkey to your desired key
  3.     Numpad5:: ;//Number Pad 5 hotkey
  4.     {
  5.      
  6.                 while GetKeyState("Numpad5")    ;//while Number Pad 5 key is held
  7.                 {
  8.                         Traytip, Key Is Held, Your hotkey is being held., ,1
  9.      
  10.                         IfWinExist, Date and Time ;//Windows clock & date
  11.                                 Continue
  12.                         IfWinNotExist, Date and Time
  13.                                 run, Timedate.cpl
  14.                 }
  15.  
  16.                 sleep, 3000    ;//small delay
  17.                 Traytip
  18.      
  19.                 WinClose, Date and Time ;//upon release close the window
  20.     }
  21.     Return
  22.      
  23.     ESC & Numpad5:: ;//esc & Number Pad 5 will exit the script
  24.                 Critical
  25.                 ExitApp
  26.     Return

16
Post New Requests Here / Re: Flood Alert (As service or tray apps)
« on: August 20, 2013, 04:04 PM »
Try this out & let me know if it was close to what you were thinking.

Note: Right click as I added everything to the tray menu

*Added the doppler radar image(s)*


17
Post New Requests Here / Re: Flood Alert (As service or tray apps)
« on: August 20, 2013, 02:09 PM »
So you want the alert plus that image?

It's possible to add the image & would just need to be worked in.  I'll add that to my list of items to address.



~BigVent

18
Post New Requests Here / Re: Flood Alert (As service or tray apps)
« on: August 20, 2013, 09:50 AM »
Did the program alert you again?   :D

I need to revisit this program & do some work on the GUI & other items.


~BigVent

19


Code: Autohotkey [Select]
  1.  
  2. ;//change hotkey to your desired key
  3. Numpad5::       ;//Number Pad 5 hotkey
  4. {
  5.                
  6.         while GetKeyState("Numpad5")    ;//while Number Pad 5 key is held
  7.         {
  8.                 Traytip, Key Is Held, Your hotkey is being held., ,1
  9.                
  10.                 IfWinExist, Date and Time Properties    ;//Windows clock & date
  11.                         Continue
  12.                 IfWinNotExist, Date and Time Properties
  13.                         run, Timedate.cpl
  14.         }
  15.         Traytip
  16.  
  17.                 WinClose, Date and Time Properties      ;//upon release close the window
  18. }
  19. Return
  20.  
  21. ESC & Numpad5:: ;//esc & Number Pad 5 will exit the script
  22.         Critical
  23.         ExitApp
  24. Return

20
Post New Requests Here / Re: IDEA: AutoMaximize Windows
« on: June 20, 2013, 02:53 PM »
Added functionality so that if your program window opens minimized it handles that as well.


~BigVent

21
Post New Requests Here / Re: IDEA: AutoMaximize Windows
« on: June 19, 2013, 04:10 PM »
*Amended*:

"would maximize automatically every maximizable window, when new windows of apps/Explorer etc opening."
 
   As I re-read the other linked thread I think this is more suitable for your needs.

Enjoy!


Code: Autohotkey [Select]
  1. ;http://www.autohotkey.com/board/topic/19672-detect-when-a-new-window-is-opened/
  2. ;DLLCall / Shell / MsgBox = SKAN
  3.  
  4. ;-------------------------------------------------------------------
  5. ;--Program monitors newly opened windows & maximizes accordingly--
  6. ;-------------------------------------------------------------------
  7.  
  8. SetWorkingDir %A_ScriptDir%
  9. onexit, exitsub
  10.  
  11. Gui +LastFound
  12. hWnd := WinExist()
  13.  
  14. DllCall( "RegisterShellHookWindow", UInt,hWnd )
  15. MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )
  16. OnMessage( MsgNum, "ShellMessage" )
  17. Return
  18.  
  19. ShellMessage( wParam,lParam )
  20. {
  21.   Local k
  22.   If ( wParam = 1 ) ;  HSHELL_WINDOWCREATED := 1
  23.   {
  24.        NewID := lParam
  25.        SetTimer, MsgBox, -1
  26.   }
  27. }
  28.  
  29.          WinGetTitle, Title, ahk_id %NewID%
  30.          WinGetClass, Class, ahk_id %NewID%
  31.          WinWait, ahk_id %NewID%
  32.                 TrayTip, New Window Opened, Title:`t%Title%`nClass:`t%Class%
  33.         minmax_func()
  34. Return
  35.  
  36. ralt & Esc::    ;right Alt key & Esc
  37. exitsub:
  38. {
  39.     critical
  40.         Exitapp
  41. }
  42.  
  43. ;=================
  44. ;==Function(s)====
  45. ;=================
  46. minmax_func()
  47. {
  48.         global NewID, minmax
  49.         WinGet, minmax, minmax, ahk_id %NewID%
  50.  
  51.    if (minmax=0)
  52.    {
  53.       WinMaximize, ahk_id %NewID%
  54.           ;use PostMessage for stubborn windows
  55.           ;PostMessage, 0x112, 0xF030,,, NewID  ; 0x112 = WM_SYSCOMMAND, 0xF030 = SC_MAXIMIZE
  56.    }
  57.    else
  58.         if (minmax=-1)
  59.         {
  60.                 WinRestore, ahk_id %NewID%
  61.         }
  62. }

~BigVent

22
psionics,

   You're most welcome!  I'm VERY happy to hear that this is aiding you!!!  I figured that if it could (save/warn) at least one person then it's worth any amount of time invested!

   Did this app alert you personally?   Is there anything you can see that needs to be adjusted, changed, added?


Again, thank you for the feedback!


~BigVent

23
Seems to be back up now


~BigVent

24
Thank you mouser!!! Much appreciated!

~BigVent

25
Hey psionics, thank you for the feedback!

* if we didn't put an entry on email/txt/smtp functions, will it not function by default? or can we have an enable/disable box for the email/txt/smtp functions(to save bandwidth/sms during non-alerting days) or a button to toggles between alerting/normal days?

  • Now you can select whether or not you'd like to enter your information.  At any time you can rt. click tray icon & change location or email/text information

* have a hyperlink to http://121.58.193.22.../html/wl/wl_map.html  - near the location selector(so they will have the initial idea where they are located)

  • Great idea & has been implemented

* can we use a different icon? (lets look for one)
  • I chose the Philippines flag for the current icon.  If you think of one better just let me know & we'll incorporate

* can we name the apps as floodwatch.exe(instead of pagasa.exe) and rename "Philippines Flood Information and Alert" into "Flood Watch Philippines"

  • Absolutely!  Done

Items that I'll work on:
  • Make a better GUI for the program. (I've only been focused on the functionality)
  • Testing on different OS to ensure everything works properly
  • Will remove the "Press F10 for direct site within the notification

~BigVent

Pages: [1] 2next