 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
DeWild1
Joined: 30 Apr 2006 Posts: 314 Location: Shigle Springs
|
Posted: Thu Jan 31, 2008 8:25 pm Post subject: Notepad++ autosave and launch |
|
|
I lost a full days work yesterday!
So here is my first public script to fix that!
| Code: |
/*
Notepad++ autosave and launch
If notepad++ is active, and you have not touched the keyboard or mouse for 5 sec, it saves all.
Then, it checks to see if there has been no activity for 15 min, if notepad++ is still runing, even if it is not active, it brings it to the front and saves.. (lunch time) :-)
*/
DetectHiddenText, On
SetTitleMatchMode, 2
SetBatchLines -1
#SingleInstance ignore
#WinActivateForce
#notrayicon
;if notepad++ is not running
process, exist, notepad++.exe
If ! errorLevel
{
run, %A_ProgramFiles%\Notepad++\Notepad++.exe
}
sleep, 60000
dome:
loop, 45 ;after 7.5 min,
{
sleep, 10000
if A_TimeIdlePhysical > 5000 ;after at least 5 sec of not doing anything and if notepad++ is currently active
{
If WinActive("ahk_class Notepad++")
{
blockinput, On
send, {Control Down}{Shift Down}s{Control Up}{Shift Up} ;save all
Blockinput, off
}
process, exist, notepad++.exe
If ! errorLevel
{
exitapp ;if not running, exit
}
}
}
if A_TimeIdlePhysical > 900000 ;if idle time more than 15 min, then force it to activate and then save.
{
winactivate ("ahk_class Notepad++")
sleep, 1000
blockinput, On
send, {Control Down}{Shift Down}s{Control Up}{Shift Up} ;save all
Blockinput, off
goto, dome
}
goto, dome
|
---edit added blockinput _________________ CPULOCK.com
virusSWAT.com
GuaranteedPCFIX.com
911PCFIX.com |
|
| Back to top |
|
 |
Deep Guest
|
Posted: Fri Oct 31, 2008 1:50 pm Post subject: Autosave |
|
|
| How do we apply your script to notepad++ |
|
| Back to top |
|
 |
Guest
|
Posted: Fri Oct 31, 2008 2:25 pm Post subject: Re: Autosave |
|
|
| Deep wrote: | | How do we apply your script to notepad++ |
Just run the script. After a period of inactivity (keyboard/mouse) it will automatically save your files.
If you start the script and notepad++ is not running, it will start it (provided it is located at %A_ProgramFiles%\Notepad++\Notepad++.exe). If you exit notepad++, the script will also exit. |
|
| Back to top |
|
 |
RoutnAbout Guest
|
Posted: Sat Feb 28, 2009 3:42 pm Post subject: |
|
|
Can this script be used on other software also?
If so what do I need to change? |
|
| Back to top |
|
 |
DeWild1
Joined: 30 Apr 2006 Posts: 314 Location: Shigle Springs
|
Posted: Sat Mar 07, 2009 12:59 am Post subject: |
|
|
| RoutnAbout wrote: | Can this script be used on other software also?
If so what do I need to change? |
Just find out what keys you need it to work with by Doing ALT on your keyboard then just use the keys to find out the sequence and use Windows Spy to find out the title and stuff. _________________ CPULOCK.com
virusSWAT.com
GuaranteedPCFIX.com
911PCFIX.com |
|
| Back to top |
|
 |
Guest
|
Posted: Fri Apr 03, 2009 7:51 am Post subject: Re: Autosave |
|
|
| Anonymous wrote: | | Deep wrote: | | How do we apply your script to notepad++ |
Just run the script. After a period of inactivity (keyboard/mouse) it will automatically save your files.
If you start the script and notepad++ is not running, it will start it (provided it is located at %A_ProgramFiles%\Notepad++\Notepad++.exe). If you exit notepad++, the script will also exit. |
I use notepad++ for a statistical software package and would like to adopt your code. But I know nothing about real programming. Where should I run your script? Could you give me some detailed instructions? I use window XP.
Many thanks  |
|
| Back to top |
|
 |
mike2009 Guest
|
|
| Back to top |
|
 |
chinkaling
Joined: 20 Jul 2008 Posts: 2
|
Posted: Tue Aug 04, 2009 8:16 pm Post subject: Re: Plugin for Notepad++ |
|
|
Nice try, but that plugin's smallest time interval is 1 minute. That's completely useless to me, and many others who are concerned about losing a huge sum of data between 60 seconds... This script [with slight modifications for my purposes at least] is the perfect solution for that.
Great job on your first public script, DeWild1! |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|