AutoHotkey Community

It is currently May 27th, 2012, 6:17 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 28 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: November 26th, 2010, 12:08 pm 
Offline
User avatar

Joined: May 18th, 2010, 3:10 pm
Posts: 1179
Location: Sweden
vaderetro wrote:
understood, thanks.

I prefer the idea of all running under a single process, but maybe it's just a silly search of optimizing everything when possible.

Is having, say, 10 ahk processes that just wait for hotkeys and things like that totally negligible in a current pc in terms of processing overhead?? Or do people try to run everything under a single process?

What is the general consensus among the community?


Running an AHK process, no matter how small, takes atleast a certain amount of memory, so running 10-20 scripts would not be optimal (even if I think the overall computer performance wouldn't be much affected). Many people prefer to run it under a single process, I bet. The problem with that is that editing the script can get tedious, and like you say - it can cause errors too.

As for me, I run a few scripts constantly, and like to keybind-in the rest of them (that is, run them via a keybind). I think I am not alone, so that's the reason for this master script. The idea is that you don't have to autolaunch any scripts, you can choose:

1) Which scripts do I *always* want running? (Autostart)
2) Which scripts do I want to start with hotkeys? (Hotkey)
3) Which scripts do I use "sometimes", but want to access easely? (Start via Master Script GUI)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 26th, 2010, 8:02 pm 
Offline
User avatar

Joined: May 18th, 2010, 3:10 pm
Posts: 1179
Location: Sweden
There's an update up, I edited the CODE (but not the link) in the first post. It's not done, but atleast this one is stable enough for releasing.

I had to fix a couple of things to make the launch work with the recursive search (sorting in alphabetical order doesn't affect the order of the folders, so it got a bit messy), and to make the tabs work.

I've also started to work on some settings. I plan to implement "Disable recursive search" and any number of extra folders to search. I may also categorize the scripts folderwise, and only within the solder sort alphabetically. It may not be visible now, but that's the way the scripts should be sorting for you.

Regards,
Sumon

PS. Also added credits to small_coder.

Code:
; Script working name: Master Script
; Language:       English
; Platform:       Windows 7
; Author: Sumon (find me at AHK forums, www.autohotkey.com/forum)
; With help from: small_c0d3r
; Script Function: To be added: Searches "this" (%A_ScriptDir%) folder for scripts, and shows a GUI for enabling/disabling them, launching them, and adding hotkeys to launch them.
#singleinstance force
; Menu, Tray, Icon , msicon.ico, 1, 1 ---- OMG the icon was fugly
FileList =  ; Initialize to be blank.
Loop, *.ahk, 0, 1
{
   If (A_LoopFileDir = "Inactive Scripts")
      Continue
   Else
   {      
    FileList = %FileList%%A_LoopFileName%`n ;`n
   If (A_LoopFileDir = "")
      FileDir = %FileDir%\`n
   Else
      FileDir = %FileDir%`n%A_ScriptsDir%%A_LoopFileDir%\`n
}
}
Loop, parse, FileDir, `n
{
    if A_LoopField =  ; Ignore the blank item at the end of the list, for Directories
   {
   ; FileCount := A_Index-1 ; To also ignore the blank item in future "filecounts"
   continue
   }
   Dir%A_Index% = %A_LoopField%
}
; Sort, FileList
Loop, parse, FileList, `n
{
    if A_LoopField =  ; Ignore the blank item at the end of the list.
   {
   FileCount := A_Index-1 ; To also ignore the blank item in future Filecounts
        continue
      }
      File%A_Index% = %A_LoopField%
   /*
   MsgBox, 4,, File number %A_Index% is %A_LoopField%.  Continue?
    IfMsgBox, No
        break
      */
}
IniWrite, %Filecount%, Master Script Settings.ini, Filecount, Filecount
IniRead, Filecount, Master Script Settings.ini, Filecount, Filecount, 0
Loop, %Filecount% ; Inireads all needed values
{
   Iniread, Scriptname%A_Index%, Master Script Settings.ini, Scriptname, Script%A_Index%
   Iniread, Autostart%A_Index%, Master Script Settings.ini, Autostart, Script%A_Index%
   Iniread, Hotkey%A_Index%, Master Script Settings.ini, Hotkey, Script%A_Index%
   Iniread, Winkey%A_Index%, Master Script Settings.ini, Winkey, Script%A_Index%
   IniRead, ScriptDir%A_Index%, Master Script Settings.ini, Directory, Script%A_Index%, %A_ScriptDir%
   ; File%A_Index% := Scriptname%A_Index% <--- Commented out since there was a conflict
}
CreateGUI:
Gui -Maximizebox
Gui, Add, Text,, ... parsed your folder(s) for %Filecount% files...
Gui, Add, Button, gSubmit, Save && Update
; Gui, Add, Button, xp+95 yp gMasterstartup, Master Startup
Gui, Add, Button, xp+90 yp gReset, Reset
Gui, Add, Button, xp+50 yp w25 gHelp, ?
Gui, Add, Button, xp+30 yp gSettings, Settings
Gui, Add, Button, xp+50 yp gExit, Exit
Gui, Add, Text, y+15 xp-200, Run script   |   Autostart   |   Hotkey   |   +Win key?   |    Hide
Gui, Add, Tab, w300 h960 Buttons, 1-15|16-30|31-45|46-60|61-75
Gui, Tab, 1
Loop, %Filecount%
{
FileText := File%A_Index%
CurrentScriptDir := ScriptDir%A_Index%
PreviousScriptDir := "Null"
If (CurrentScriptDir ! PreviousScriptDir)
MsgBox New directory is %CurrentScriptDir%
   ;Gui, Add, Text, x20 yp+35, %CurrentScriptDir%
PreviousScriptDir := ScriptDir%A_Index%
If (A_Index = 16)
   Gosub, NewTab16
If (A_Index = 31)
   Gosub, NewTab31
If (A_Index = 46)
   Gosub, NewTab46
If (A_Index = 61)
   Gosub, NewTab61
Gui, Add, GroupBox, x20 yp+35 w350, %FileText%
GUI, Add, Button, Section xp+10 yp+20 h20 r1 gLaunchFileselect, %A_Index%
LaunchindexN = Launchindex%A_Index% ; ?
n := Autostart%A_Index%
Gui, Add, Checkbox, xp+70 yp+5 r1 vAutostartN%A_Index% checked%n%
n := Hotkey%A_Index%
Gui, Add, Hotkey, xp+50 yp-5 w70 vHotkeyN%A_Index%, %n%
n := Winkey%A_Index%
Gui, Add, Checkbox, xp+75 yp+5 r1 vWinkeyN%A_Index% checked%n%
Gui, Add, Checkbox, xp+75 yp vDeactivateN%A_Index%
LastScriptListed = %A_Index%
}
Gui, Color, EFFAE8
Gui, Show
return
NewTab16:
Gui, Tab, 2
Gui, Add, Text, x0 y100,
return
NewTab31:
Gui, Tab, 3
Gui, Add, Text, x0 y100,
return
NewTab46:
Gui, Tab, 4
Gui, Add, Text, x0 y100,
return
NewTab61:
Gui, Tab, 5
Gui, Add, Text, x0 y100,
return
reset:
Gui, Destroy
Gosub, CreateGUI
return
Submit:
Gui, Submit, nohide
Loop, %FileCount%
{
ScriptnameIni := File%A_Index%
IniWrite, %ScriptnameIni%, Master Script Settings.ini, Scriptname, Script%A_Index%
AutostartIni := AutostartN%A_Index%
DirIni := Dir%A_Index%
IniWrite, %DirIni%, Master Script Settings.ini, Directory, Script%A_Index% ; This row and above was added by small_c0d3r to allow for recursing foldersearch
IniWrite, %AutostartINI%, Master Script Settings.ini, Autostart, Script%A_Index%
HotkeyINI := HotkeyN%A_Index%
IniWrite, %HotkeyINI%, Master Script Settings.ini, Hotkey, Script%A_Index%
WinkeyINI := WinkeyN%A_Index%
IniWrite, %WinkeyINI%, Master Script Settings.ini, Winkey, Script%A_Index%
DeactivateINI := DeactivateN%A_Index% ; Yes, I know the this INI value won't be used, but can be good to have if someone wants to change the script
IniWrite, %DeactivateIni%, Master Script Settings.ini, Deactivate, Script%A_Index%
Filemovetext := File%A_Index%
FileCreateDir, Inactive Scripts
If (DeactivateN%A_Index% = 1)
FileMove, %DirIni%\%Filemovetext%, %A_ScriptDir%\Inactive Scripts\
}
reload
return
Settings:
Iniread, Extrafolder1, Master Script Settings, ExtraFolder, 1, _ _ _
Gui, 2:+Owner1 +Resize
Gui, 2: Add, Text,, SETTINGS ARE NOT YET FUNCTIONING - THEY ARE TO BE IMPLEMENTED SOON (tm)
Gui, 2:Add, Text,, Folders to be searched...`nDefault: %A_ScriptDir%`n1: %ExtraFolder1%`n2: %ExtraFolder2%`n3: %Extrafolder3%
Gui, 2: Add, Button, gAddFolder, Add folder...
Gui, 2:Add, Button, gSubmit2, Save settings
Gui, 2:Show, w400 h300, Settings
return
AddFolder:
FileSelectFolder, ExtraFolder1, *%A_ScriptDir%,, Select a folder to include in future searches
IniWrite, %Extrafolder1%, Master Script Settings, ExtraFolder, 1
return
Submit2:
Gui, 2:Submit
Gui, 2:Destroy
return
Exit:
ExitApp
return
reload:
Reload
return
Masterstartup:
MsgBox FAIL
return
Help:
MsgBox Run script - Runs the chosen script `nAutostart - The chosen script will always start when you start your computer `nHotkey & Win key - Assign a hotkey to launch the selected script, if you want to combine it with the Windows key: Also tick the "Win key?" button (remember to deactivate it when it's not used) `nDeactivate - Moves the designated script to a subfolder called "Inactive scripts", so it will not appear in this list
return
Launch:
SoundPlay, *64
Run, %FiletoLaunch%
return
; THE FOLLOWING "LaunchFileSelect subroutine considers which button was pressed (thanks to small_c0d3r)
LaunchFileSelect:
Selected_File:= File%A_GuiControl%
Selected_File_Dir:= Dir%A_GuiControl%
FiletoLaunch = %A_ScriptDir%%Selected_File_Dir%%Selected_File%
;Msgbox, %FiletoLaunch%
Gosub, Launch
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 27th, 2010, 7:06 am 
Offline

Joined: November 29th, 2009, 7:53 am
Posts: 46
Location: Queensland
thnx for the reference
btw how does this script handle with the adding or removing of a script from the folder
cause i played more with the old release and discovered a way to keep all data together incase of new scripts but didn't find a way to reuse the keys of the files that are removed from the folder
Code:
IniRead, IniFilecount, Master Script Settings.ini, Filecount, Filecount, 0
Loop, %IniFilecount% ; Inireads all needed values
{
   Iniread, Scriptname%A_Index%, Master Script Settings.ini, Scriptname, Script%A_Index%,0
   Iniread, Autostart%A_Index%, Master Script Settings.ini, Autostart, Script%A_Index%,0
   Iniread, Hotkey%A_Index%, Master Script Settings.ini, Hotkey, Script%A_Index%
   Iniread, Winkey%A_Index%, Master Script Settings.ini, Winkey, Script%A_Index%,0
   IniRead, Deactivate%A_Index%, Master Script Settings.ini, Deactivate, Script%A_Index%,0
   IniRead, ScriptDir%A_Index%, Master Script Settings.ini, Directory, Script%A_Index%, %A_ScriptDir%
   ; File%A_Index% := Scriptname%A_Index% <--- Commented out since there was a conflict
}
Loop,%IniFilecount%
{
   Search:= ScriptDir%A_Index% Scriptname%A_Index%
   ;MsgBox,%Search%
   IfNotExist,%Search%
   {
      ;Msgbox,file not found
      ;Msgbox
      IniDelete, Master Script Settings.ini, Scriptname, Script%A_Index%
      IniDelete, Master Script Settings.ini, Autostart, Script%A_Index%
      IniDelete, Master Script Settings.ini, Hotkey, Script%A_Index%
      IniDelete, Master Script Settings.ini, Winkey, Script%A_Index%
      IniDelete, Master Script Settings.ini, Deactivate, Script%A_Index%
      IniDelete, Master Script Settings.ini, Directory, Script%A_Index%
   }
}
Loop, *.ahk,0,1
{
   If(A_LoopFileDir = "Inactive Scripts")
      Continue
   Else
   {
      Loop,%IniFilecount%
      {
         FileEntryExist=0
         ;Msgbox,%A_Index%
         SplitPath,A_LoopFileFullPath,FileCheck,DirCheck
         If(DirCheck ="")
            DirCheck = %A_ScriptDir%\
         Else
            DirCheck=%A_ScriptDir%\%A_LoopFileDir%\
         FileChecker:=Scriptname%A_Index%
         DirChecker:=ScriptDir%A_Index%
         foundnotdir=0
         ;Msgbox,%FileCheck% = %FileChecker% and %DirCheck% = %DirChecker%
         If(FileCheck <> FileChecker)
         {
            ;Msgbox, File Doesn't match
            Continue
         }
         Else
         {
            ;Msgbox,File Exists
            If(DirCheck == DirChecker )
            {
               ;Msgbox,File Exists in Directory
               FileEntryExist=1
               num:=A_Index-foundnotdir
               ;MsgBox,%num%
               Break
            }
            Else
            {
               foundnotdir++
               ;Msgbox,File doesn't Exist in Directory
            }
         }
      }
      ;Msgbox, File Existance is %FileEntryExist%
      If(FileEntryExist = 1)
      {
         Iniread, Autostart%num%, Master Script Settings.ini, Autostart, Script%num%,0
         Iniread, Hotkey%num%, Master Script Settings.ini, Hotkey, Script%num%
         Iniread, Winkey%num%, Master Script Settings.ini, Winkey, Script%num%,0
         IniRead, Deactivate%num%, Master Script Settings.ini, Deactivate, Script%num%,0
         ;Msgbox, Autostart%num% "|" Hotkey%num%"|"Winkey%num%"|"Deactivate%num% ":" Scriptname%num%
         Continue
      }
      Else
      {
         ;Msgbox,%A_LoopFileName% doesn't exist in the records
         FileList = %FileList%%A_LoopFileName%`n
         If(A_LoopFileDir ="")
            FileDir = %FileDir%%A_ScriptDir%\`n
         Else
            FileDir = %FileDir%%A_ScriptDir%\%A_LoopFileDir%\`n
      }
   }
}
FileCount=0
Loop, parse, FileList, `n
{
    if A_LoopField =  ; Ignore the blank item at the end of the list.
   {
      FileCount := A_Index-1 ; To also ignore the blank item in future Filecounts
      continue
   }
   addfile:= IniFilecount + FileCount
   msgbox,%addfile% file is %A_LoopField%
   Scriptname%addfile% = %A_LoopField%
      
   /*
   MsgBox, 4,, File number %A_Index% is %A_LoopField%.  Continue?
    IfMsgBox, No
        break
      */
}
FileCount=0
Loop, parse, FileDir, `n
{
    if A_LoopField =  ; Ignore the blank item at the end of the list.
   {
      FileCount := A_Index-1 ; To also ignore the blank item in future Filecounts
      continue
   }
   msgbox,%addfile% file is %A_LoopField%
   ScriptDir%addfile% = %A_LoopField%
   
   /*
   MsgBox, 4,, File number %A_Index% is %A_LoopField%.  Continue?
    IfMsgBox, No
        break
      */
}
FileCount:=IniFilecount+FileCount
Msgbox,%FileCount%
IniWrite, %Filecount%, Master Script Settings.ini, Filecount, Filecount
IniRead, Filecount, Master Script Settings.ini, Filecount, Filecount, 0
Loop, %addfile%   ;adds the files to the Master Script Settings.ini file
{
   DirIni := ScriptDir%addfile%
   IniWrite, %DirIni%, Master Script Settings.ini, Directory, Script%addfile%
   ScriptnameIni := Scriptname%addfile%
   IniWrite, %ScriptnameIni%, Master Script Settings.ini, Scriptname, Script%addfile%
}

Loop, %Filecount% ; Inireads all needed values
{
   Iniread, Scriptname%A_Index%, Master Script Settings.ini, Scriptname, Script%A_Index%,0
   Iniread, Autostart%A_Index%, Master Script Settings.ini, Autostart, Script%A_Index%,0
   Iniread, Hotkey%A_Index%, Master Script Settings.ini, Hotkey, Script%A_Index%
   Iniread, Winkey%A_Index%, Master Script Settings.ini, Winkey, Script%A_Index%,0
   IniRead, Deactivate%A_Index%, Master Script Settings.ini, Deactivate, Script%A_Index%,0
   IniRead, ScriptDir%A_Index%, Master Script Settings.ini, Directory, Script%A_Index%, %A_ScriptDir%
   ; File%A_Index% := Scriptname%A_Index% <--- Commented out since there was a conflict
}
CreateGUI_Stage1:
;the first peice doesn't have to reside in this area but it is added here for easier editing as it is part of the gui creation process
Files:= FileCount
GuiMaxCount =  1
Loop   ;dicovering how many gui windows are required to show the whole file list
{
   If(Files > 15)   ;15 choosen as the limit of programs per gui
   {
      GuiMaxCount++
      Files -= 15
      Continue
   }
   Else   ;if there is less than 15 files no extra guis required
   {
      Break
   }
}
window = 0   ;set to blank to allow for incrimental counting
CreateGUI_Stage2:
window ++   ;add 1 to window to keeptrack of what gui window we are editing
If (window > GuiMaxCount)   ; if script tries to make uneeded windows this if will prevent it
   Gosub,Exit
Else   ;create the gui
{
   Low_Lim:= 15*(window-1)+1   ;calculating for the text of the gui
   if(window = GuiMaxCount)   ;deciphering wether the gui is a full gui or a partial one and calculating the appropriate High_Lim
      High_Lim:= FileCount
   Else
      High_Lim:= 15*window
   ;add the controls of the current gui
   Gui, %window%:Default
   Gui, %window%: Add, Text,, ... %FileCount% files found showing results %Low_Lim% to %High_Lim%   ; text to show the user what files of the filecount are showed on the gui
   Gui, %window%: Add, Button, gSubmit, Save && Exit
   Gui, %window%: Add, Button, xp+70 yp gReset, Reset
   Gui, %window%: Add, Button, xp+55 yp w25 gHelp, ?
   Gui, %window%: Add, Button, xp+35 yp gExit, Exit
   Gui, %window%: Add, Text, y+15 xp-150, Run script   |   Autostart   |   Hotkey   |   +Win key?   |    Deactivate
   Loop, 15   ;add the controls for each program shown in the gui
   {
      instance :=(15*(window - 1)) + A_Index   ;becuase of multiple windows a_Index is unable to be used thus current program has to be calculated
      ;MsgBox, %instance%
      If(instance > FileCount)   ;since it repeats 15 times must ensure that only the amount of files is added not any extras usually blanks
         Break
      Else   ;same process as in orignial script except %instance% used instead of %A_Index%
      {
         FileText := ScriptName%instance%
         Gui, %window%: Add, GroupBox, xs0 w350, %FileText%
         Gui, %window%: Add, Button, xp+10 yp+20 h20 r1 gLaunchFileSelect, %instance%   ;set to the file number to allow the "LaunchFileSelect" subroutine to be able to function correctly
         LaunchindexN = Launchindex%instance% ; ?
         n := Autostart%instance%
         Gui, %window%: Add, Checkbox, xp+70 yp+5 r1 vAutostartN%instance% checked%n%
         n := Hotkey%instance%
         Gui, %window%: Add, Hotkey, xp+50 yp-5 w70 vHotkeyN%instance%, %n%
         n := Winkey%instance%
         Gui, %window%: Add, Checkbox, xp+75 yp+5 r1 vWinkeyN%instance% checked%n%
         n:= Deactivate%instance%
         Gui, %window%: Add, Checkbox, xp+75 yp vDeactivateN%instance%   checked%n%
      }
   }
   Gui, %window%:Show, Autosize, Master Script settings (window %window% of %GuiMaxCount%)   ;title showing which window of the series it is
   Return
}

return
reset:
Run,%A_ScriptFullPath%
return
Submit:
Gui,Submit
Loop, 15
{
   instance :=(15*(window - 1)) + A_Index
   If(instance > FileCount)   ;since it repeats 15 times must ensure that only the amount of files is added not any extras usually blanks
      Break
   Else   ;same process as in orignial script except %instance% used instead of %A_Index%
   {
      DirIni := ScriptDir%instance%
      ;MsgBox, ScriptDir%instance% is %DirIni%
      IniWrite, %DirIni%, Master Script Settings.ini, Directory, Script%instance%
      ScriptnameIni := Scriptname%instance%
      IniWrite, %ScriptnameIni%, Master Script Settings.ini, Scriptname, Script%instance%
      AutostartIni := AutostartN%instance%
      IniWrite, %AutostartINI%, Master Script Settings.ini, Autostart, Script%instance%
      HotkeyINI := HotkeyN%instance%
      IniWrite, %HotkeyINI%, Master Script Settings.ini, Hotkey, Script%instance%
      WinkeyINI := WinkeyN%instance%
      IniWrite, %WinkeyINI%, Master Script Settings.ini, Winkey, Script%instance%
      DeactivateINI := DeactivateN%instance% ; Yes, I know the this INI value won't be used, but can be good to have if someone wants to change the script
      IniWrite, %DeactivateIni%, Master Script Settings.ini, Deactivate, Script%instance%
      Filemovetext := File%instance%
      FileCreateDir, Inactive Scripts
      If (DeactivateN%instance% = 1)
      {   
         MsgBox, 4, ,Do you want to move %FileMoveText% to %Inactive_Dir%
         IfMsgBox Yes
            FileMove, %Filemovetext%, %Inactive_Dir%
         Else
            Continue
      }
   }
}
Gui,Destroy
Goto,CreateGUI_Stage2
return
Exit:
ExitApp
return
reload:
Reload
return
Masterstartup:
MsgBox FAIL
return
Help:
MsgBox Run script - Runs the chosen script `nAutostart - The chosen script will always start when you start your computer `nHotkey & Win key - Assign a hotkey to launch the selected script, if you want to combine it with the Left Windows key: Also tick the "Win key?" button `nDeactivate - Moves the designated script to a subfolder called "Inactive scripts", so it will not appear in this list
return
Launch:
SoundPlay, *64
Run, %FiletoLaunch%
return
; THE FOLLOWING "LaunchFileSelect" subroutine uses the name of the button to decipher what file the user wants to run, collects it respectable directory, colaborates these together to give a path to the file to be sent to the Launch subroutine
LaunchFileSelect:
Selected_File:= File%A_GuiControl%
Selected_File_Dir:= Dir%A_GuiControl%
FiletoLaunch = %Selected_File_Dir%%Selected_File%
;Msgbox, %FiletoLaunch%
Gosub, Launch
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 27th, 2010, 1:15 pm 
Offline
User avatar

Joined: May 18th, 2010, 3:10 pm
Posts: 1179
Location: Sweden
I'm sorry, please elaborate. I don't exactly understand what you are after.

From what I see and understand, you seem to have added the script code around "Filechecker" and "Dircheck" etc.. The functionality that you want is that if a new script is added, old scripts still "retain" their hotkeys etc.?

What I am planning on doing now:
1) Sorting (saving) the .INI after Script-name instead of scriptposition ("Script1"). This way the scripts can retain their information (even after they are hidden).
2) Change the way "Hide" works - it shouldn't even try to move the scripts (which doesn't even seem to work in this release), it should only not show them in the GUI, simply skip them. There could be a "Show hidden" feature too, so one could dehide them, of course.
3) Change the Buttons/Menu on the top to a Menu, for adding more options.
4) Have the "Save & Update" script reload Master Script Startup (else the changes won't really go through).

Is there any good way to update the GUI without closing the script btw?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 28th, 2010, 7:18 am 
Offline

Joined: November 29th, 2009, 7:53 am
Posts: 46
Location: Queensland
yeah thats exactly wat i'm after

question regarding future features;
wouldn't there have to be a way for the script to decipher between two scripts of the same name but different directories

Question regarding new release;
wouldn't it be better to have only the specific amount of tabs required for the amount of scripts found
have got the new release to play with will respond after achieving any of the goals u have mentioned or others i believe will improve usability


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 5th, 2010, 12:37 am 
Offline
User avatar

Joined: May 18th, 2010, 3:10 pm
Posts: 1179
Location: Sweden
small_c0d3r wrote:
yeah thats exactly wat i'm after

question regarding future features;
wouldn't there have to be a way for the script to decipher between two scripts of the same name but different directories

Question regarding new release;
wouldn't it be better to have only the specific amount of tabs required for the amount of scripts found
have got the new release to play with will respond after achieving any of the goals u have mentioned or others i believe will improve usability


Yeah, there would have to be a way to decipher between two scripts of the same name, should be doable.

Regardings tabs: Yes, it would be optimal to have it only create a specified number of tabs. It'd probably also be nice to add an option to only list f.ex. 10 per script, as I noticed smaller screens only fit 14 or so.

I'm gonna work on stability first though.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 5th, 2010, 11:20 pm 
Offline

Joined: November 29th, 2009, 7:53 am
Posts: 46
Location: Queensland
righteo then
heres an example of how the dyamic tabs would be scripted works with different numbers of scripts/tab;
Code:
CreateGUI:
MaxProgsPerTab=15   ; would be set through an iniread of the settings earlier in the script
Files:= FileCount   ;set another variable with the same number as filecount to allow for calculations to be made without affecting FileCount
TabMaxCount =  1    ; set as such as the loop only accomadates for the need for extra tabs
Loop   ;dicovering how many gui windows are required to show the whole file list
{
   If(Files > MaxProgsPerTab)   ;MaxProgsPerTab set as the ammount of programs allowed in one tab
   {
      TabMaxCount++   ;needs an extra tab so add it on
      Files -= MaxProgsPerTab ;reduce the number next turn
      Continue
   }
   Else   ;if there is less than MaxProgsPerTab files no extra guis required
   {
      MsgBox,%TabMaxCount%
        Break
   }
}
Loop,%TabMaxCount%
{
   Low_Lim:= MaxProgsPerTab*(A_Index-1)+1   ;calculating for the text of the gui
   if(A_Index = TabMaxCount)   ;deciphering wether the gui is a full gui or a partial one and calculating the appropriate High_Lim
      High_Lim:= FileCount
   Else
      High_Lim:= MaxProgsPerTab*A_Index
   ;Following section sets the tab names for the gui
   If(A_Index=1)
      TabName=%Low_Lim%-%High_Lim%|
   Else
   {
      If(A_Index=TabMaxCount)
      {
         If(Low_Lim=High_Lim)
            TabName=%TabName%%Low_Lim%
         Else
            TabName=%TabName%%Low_Lim%-%High_Lim%
      }
      Else
         TabName=%TabName%%Low_Lim%-%High_Lim%|
   }
}
;Msgbox,%TabName%
Gui -Maximizebox
Gui, Add, Text,, ... parsed your folder(s) for %Filecount% files...
Gui, Add, Button, gSubmit, Save && Update
; Gui, Add, Button, xp+95 yp gMasterstartup, Master Startup
Gui, Add, Button, xp+90 yp gReset, Reset
Gui, Add, Button, xp+50 yp w25 gHelp, ?
Gui, Add, Button, xp+30 yp gSettings, Settings
Gui, Add, Button, xp+50 yp gExit, Exit
Gui, Add, Text, y+15 xp-200, Run script   |   Autostart   |   Hotkey   |   +Win key?   |    Hide
Gui, Add, Tab2, w300 h960 Buttons, %TabName%
Gui, Tab, 1

progintab=0 ; used to combine the newtabX subroutines into one subroutines
TabNum=1
ProgLim:=MaxProgsPerTab+1 ;set to tell the loop when to run the newtab subroutine
Loop, %Filecount%
{
FileText := File%A_Index%
CurrentScriptDir := ScriptDir%A_Index%
PreviousScriptDir := "Null"
If (CurrentScriptDir ! PreviousScriptDir)
MsgBox New directory is %CurrentScriptDir%
   ;Gui, Add, Text, x20 yp+35, %CurrentScriptDir%
PreviousScriptDir := ScriptDir%A_Index%

progintab++
If (progintab=ProgLim)  ;run newtab subroutine
{
   TabNum++
   Gosub, NewTab
}
Gui, Add, GroupBox, x20 yp+35 w350, %FileText%
GUI, Add, Button, Section xp+10 yp+20 h20 r1 gLaunchFileselect, %A_Index%
LaunchindexN = Launchindex%A_Index% ; ?
n := Autostart%A_Index%
Gui, Add, Checkbox, xp+70 yp+5 r1 vAutostartN%A_Index% checked%n%
n := Hotkey%A_Index%
Gui, Add, Hotkey, xp+50 yp-5 w70 vHotkeyN%A_Index%, %n%
n := Winkey%A_Index%
Gui, Add, Checkbox, xp+75 yp+5 r1 vWinkeyN%A_Index% checked%n%
Gui, Add, Checkbox, xp+75 yp vDeactivateN%A_Index%
LastScriptListed = %A_Index%
}
Gui, Color, EFFAE8
Gui, Show
return
NewTab:
progintab=1
Gui, Tab, %TabNum%  ;set by caller
Gui, Add, Text, x0 y100,
return

ur script is really helpful
just post if there is anything else i can help with


Report this post
Top
 Profile  
Reply with quote  
PostPosted: December 6th, 2010, 12:26 am 
Offline

Joined: December 6th, 2010, 12:00 am
Posts: 2
Now, for the benefit of the absolute newbies amongst us (Me!Me!):

I place the scripts I want to have autostarted in the Scripts folder, and then add the names of those scripts to Master Script. Correct? But where/how exactly?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 7th, 2010, 6:57 am 
Offline

Joined: November 29th, 2009, 7:53 am
Posts: 46
Location: Queensland
to add the scripts to start-up;
1. place scripts in the folder containing the masterscript script
2. run masterscript.ahk
3. in the gui that shall pop-up select the scripts to run on startup, or to be run by hotkey, by ticking the box in the autorun column (for startup) or input the hotkey in the supplied hotkey field (for hotkey launch)
4. repeat step 3 for every script u want to run on start-up
5. once u have made all the selections u want press the save and quit button
6. run masterscriptstartup.ahk


hope this helps


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 7th, 2010, 7:08 am 
Offline

Joined: December 6th, 2010, 12:00 am
Posts: 2
small_c0d3r wrote:
to add the scripts to start-up;...
hope this helps


Sure does, thanks :)!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 13th, 2011, 12:53 pm 
Offline
User avatar

Joined: May 18th, 2010, 3:10 pm
Posts: 1179
Location: Sweden
I developed a spinoff that should also be really useful to non-AHK-users. Read more about it in the first post.

Anyway, I call it AppStarter, and it basically lets you add & keybind ANY file, script or program, for easy access.

Image

Download it HERE or read more and find the AHK files in the first post.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 30th, 2011, 12:48 pm 
Offline

Joined: November 29th, 2009, 7:53 am
Posts: 46
Location: Queensland
sumon wrote:
I developed a spinoff that should also be really useful to non-AHK-users. Read more about it in the first post.

Anyway, I call it AppStarter, and it basically lets you add & keybind ANY file, script or program, for easy access.

Image

Download it HERE or read more and find the AHK files in the first post.

btw sumon you have fell into the same redundancy that you had in the Master Script.... n subroutines


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 30th, 2011, 1:26 pm 
Offline
User avatar

Joined: May 18th, 2010, 3:10 pm
Posts: 1179
Location: Sweden
small_c0d3r wrote:
sumon wrote:
I developed a spinoff that should also be really useful to non-AHK-users. Read more about it in the first post.

Anyway, I call it AppStarter, and it basically lets you add & keybind ANY file, script or program, for easy access.

Image

Download it HERE or read more and find the AHK files in the first post.

btw sumon you have fell into the same redundancy that you had in the Master Script.... n subroutines


Indeed. Anyway, I try to learn from my mistakes, so in Appifyer that works much better (just one subroutine). Thanks for the reminder to add some sort of script folder functionality in Appifyer.

_________________
~sumon Appifyer AHK Nova halted Recommended: AHK_L (Why?)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 28 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo, Google Feedfetcher, JamixZol, rbrtryn, Stigg and 19 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group