avatar image

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

Login with username, password and session length
  • Friday September 18, 2020, 7:38 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 - Ryan_S [ switch to compact view ]

Pages: [1]
I don't have a problem with that.  :D

You might want to check where you added that code.

1 should be added as it's own subroutine. check that where you added it is below the calls at the top. it should be between "Gosub, wait" and "Showwindow:" approx line 46.

2 should be added to the READINI subroutine, the actual line is about 321, and the code should be between the READINI:
 and Return

3 should be added to the WRITEINI subroutine, the line is about 341, as above the code should be between WRITEINI: and Return

The "Gosub, WRITEINI" is just the call to that subroutine. If you add it where you did it will not be called every time that subroutine runs. That probably explains your problems.

N.A.N.Y. 2009 / Re: NANY 2009 Release: JustCloseSomeTasks
« on: January 21, 2009, 08:37 PM »
Found it's way to Lifehacker!

Good work!  :D

Finished Programs / Re: JustToDoIt - Fast ToDo lister
« on: January 17, 2009, 10:15 AM »
This script is doing what Axem used to do where it adds a separator after the 'Refresh' menu item every time it is opened. How did you fix it in Axem?

I wrote some code for starting scripts when Axem launches. It will save the checked scripts to the .ini file, when Axem is reloaded it will read the .ini file and restart all of the scripts that were running before.

I didn't have much time to test it so let me know what you think  :D
I'd like to add functionality to close the running subroutines when you exit Axem, didn't have time to get to this this morning.

Add "GoSub, RunStartup" after "GoSub, ShowWindow"

Add the RunStartup subroutine...
Code: AutoIt [Select]
  1. RunStartup:
  2.         ;--- StartupScripts ---
  3.         ;--- loops through the array and starts scripts if they are found ---
  4.         Loop %StartupScriptsCount% {
  5.                 scriptText = % StartupScripts%A_Index%
  6.                 ; --- search through list to find matches ---
  7.                 Loop % LV_GetCount() {
  8.                         LV_GetText(RetrievedText, A_Index)
  9.                         If InStr(RetrievedText, scriptText) {
  10.                                 LV_Modify(A_Index, "Check")  ; Check each row whose first field contains the filter-text.
  11.                         }
  12.                 }
  13.         }

Add the following code to the "READINI" subroutine...   
Code: AutoIt [Select]
  1. ;--- StartupScripts ---
  2.         StartupScriptsCount = 0
  3.         ;loop through ini and read in scripts
  4.         Loop {
  5.                 StartupScriptsCount += 1
  6.                 IniRead, StartupScripts%StartupScriptsCount%, %IniFile%, Startup, %A_Index%, -1
  7.                 If StartupScripts%StartupScriptsCount% = -1
  8.                         break
  9.         }

And add the following code to the "WRITEINI" subroutine...   
Code: AutoIt [Select]
  1. ;--- StartupScripts ---
  2.         IniDelete, %IniFile%, Startup   ;clear section to rewrite
  3.         ;--- create array with script text of all checked scripts ---
  4.         StartupScriptsCount = 0
  5.         Loop {
  6.                 RowNumber := LV_GetNext(RowNumber, "Checked")  ; Resume the search at the row after that found by the previous iteration.
  7.                 if not RowNumber  ; The above returned zero, so there are no more selected rows.
  8.                         break
  9.                 LV_GetText(Text, RowNumber)
  10.                 StartupScriptsCount += 1
  11.                 StartupScripts%StartupScriptsCount% = %Text%
  12.         }
  13.         ;--- loop through scripts and write list to ini file ---
  14.         Loop %StartupScriptsCount% {
  15.                 scriptText = % StartupScripts%A_Index%
  16.                 IniWrite, %scriptText%, %IniFile%, Startup, %A_Index%          
  17.         }

I thought I'd add a script here for changing the device in Vista. I needed this for my XPS1530 for switching between the HDMI output and the speakers.

I had to write it in AutoIT because AutoHotKey doesn't support working with the SysListView directly, and I'm not a huge fan of sending keystrokes. I also couldn't find the registry keys in Vista. Seems MS has moved those.

Code: AutoIt [Select]
  1. Run("c:\windows\system32\control.exe mmsys.cpl")
  3. WinWaitActive("Sound")
  5. ControlListView("Sound", "", "SysListView321", "Select", 0) ;Select the first device in the list
  6. $result = ControlCommand("Sound", "", "Button2", "IsEnabled", "") ;checks if Set As Default button is enabled
  7. If $result Then
  8.         ;if Set As Default is enabled we can enable this device
  9.         ControlClick("Sound",  "", "Button2") ;Click Set As Default
  10.         ControlClick("Sound", "", "Button4") ;Click OK
  11.         Traytip("Audio Out", "Speakers / Headphones selected", 5, 1)
  12.         Sleep(5000)
  13.         Exit
  15. ControlListView("Sound", "", "SysListView321", "Select", 1) ;select the second device in the list
  16. $result = ControlCommand("Sound", "", "Button2", "IsEnabled", "") ;checks if Set As Default button is enabled
  17. If $result Then
  18.         ;if Set As Default is enabled we can enable this device
  19.         ControlClick("Sound",  "", "Button2") ;Click Set As Default
  20.         ControlClick("Sound", "", "Button4") ;Click OK
  21.         Traytip("Audio Out", "HDMI selected", 5, 1)
  22.         Sleep(5000)
  23.         Exit

Pages: [1]