Add another column
Re: Add another column
@garry. I use exit app garry but I have a 5 second sleep before it exits so I have time to go and press my url/program.
Re: Add another column
@garry. Lol. Yes I'm back. Hopefully just quick though. Got everything set I wanted to and got the separate colors for the title ,etc done but am wondering is it possible to separate certain sections with different colors. IE I have Red titles and want my Weather websites to be amber,My red News websites to be yellow or some other color,etc. Is this even possible?
Re: Add another column
see last example TOOLS
S;;; >>> SPACE
TOOLS;;gray;black >>> BUTTON-Backgroundcolor=Gray , Text=Black
CHARMAP_CALC_NOTEPAD;charmap;calc;notepad >> this starts 3 programs ( for test )
EDIT :
aargh I was wrong , changed the TITLE and font ...
but you wanted this : ( I'll try again ) >> I've changed , see 2nd example
1st-example : TITLE has different colors
2nd-Example : different colors for buttons AFTER the TITLE
example TOOLS , the next 2 buttons AFTER TITLE-BUTTON "Tools" have defined color ( all TITLE-buttons are red )
S;;; >>> SPACE
TOOLS;;gray;black >>> BUTTON-Backgroundcolor=Gray , Text=Black
CHARMAP_CALC_NOTEPAD;charmap;calc;notepad >> this starts 3 programs ( for test )
EDIT :
aargh I was wrong , changed the TITLE and font ...
but you wanted this : ( I'll try again ) >> I've changed , see 2nd example
---------------... IE I have Red titles and want my Weather websites to be amber,My red News websites to be yellow or some other colors ...
Code: Select all
S;;;
TOOLS;;gray;black
CHARMAP_CALC_NOTEPAD;charmap;calc;notepad
Windows_RECOVERY;rstrui;;
Code: Select all
;-------- saved at 星期四 十一月 2021-11-04 10:14 UTC --------------
;- Add another column
;- https://www.autohotkey.com/boards/viewtopic.php?f=76&t=94674
;-- Date-modified =20211104 different colors for TITLE-buttons
;-- Date-modified =20210917/3 csv Halifax / TITLE-button has another color / +Resize
;-- Date-modified =20210917/2 add TITLE or SPACE between buttons
;-- Date-modified =20210915 color buttons
;-- Date-modified =20210914 one button starts 2 URL's or programs
;--
#warn
#NoEnv
#Singleinstance,force
name1=TEST
setworkingdir,%a_scriptdir%
Gui,2:default
Gui,2: -DPIScale +Resize
transform,s,chr,127 ;- delimiter for stringsplit
WA:=A_screenwidth,HA:=A_screenheight,xx:=100
;Gui,2:Color,C8D0D4,Black ;-gray
Gui,2:Color,Black,Black
;-
;- I don't know which is the best font-size depending screen-size or scaling
;------------------------------
;-- maybe change FONT and FONTSIZE
font1=Lucida console ;- TITLE
size1=15
font2=times new roman ;- the other buttons
size2=13
;------------------------------
;--------------------
col1:=""
col2:=""
col3:=""
col4:=""
;--------------------- NAME - URL1 - URL2 - URL3 ----------------------------------------------------
;- BUTTONS : S=space / TITLE= if column-2 empty > BUTTON-BackgroundColor and Textcolor -------------
;-
sectx=
(Ltrim comments Join`r`n %
Halifax_Retales;;red;white
Halifax_Retales_Facebook;https://www.facebook.com/HalifaxReTales;;
Halifax_Retales_Chat;https://www.facebook.com/groups/HalifaxReTalesChat/?fref=mentions;;
Halifax_Retales_Twitter;https://twitter.com/HalifaxReTales;;
S;;;
Weather;;F7B900;black
Weather_Network;https://www.theweathernetwork.com/ca/weather/nova-scotia/halifax;;
National_Hurricane_Center;https://www.nhc.noaa.gov/?atl;;
Canada_Hurricane_Center;https://weather.gc.ca/hurricane/track_e.html;;
S;;;
Utilities;;red;White
Bell_Aliant;https://mybell.bell.ca/Login?TYPE=33554433&REALMOID=06-000db269-81bc-1874-88d4-791a8e75d0dd&GUID=&SMAUTHREASON=0&METHOD=GET&SMAGENTNAME=-SM-QKP7nnHXh2qXJfMWInHziJlTBdI9C7eOEOJRmIO63Oa%2fimktrTgbipB8hCBdh8Ey&TARGET=-SM-HTTPS%3a%2f%2fmybell%2ebell%2eca%2fMobility%3fAcctNo%3d8D711C5DA4B3704F0A5FE8ED0DB141225B124765045364C13F3345E0CA9697EBA72FAFBE86087BF101511830FD449071%26SubNo%3d13180274;;
NS_Power;https://myaccount.nspower.ca/;;
News;;YELLOW;Black
Chronicle_Herald;https://www.thechronicleherald.ca/;;
Global_News;https://globalnews.ca/halifax/;;
Halifax_Today;https://www.halifaxtoday.ca/;;
NY_Post;https://nypost.com/;;
Las_Vegas_Sun;https://lasvegassun.com/;;
CNN_News;https://www.cnn.com/;;
S;;;
TV_Guide;https://www.tvtv.ca/ns/halifax/lu4663D;;
TD_Bank;https://authentication.td.com/uap-ui/index.html?consumer=easyweb&locale=en_CA#/login/easyweb-getting-started;;
S;;;
Amazon_Canada;https://www.amazon.ca/;;
Amazon_Canada_Phone;https://gethuman.com/phone-number/Amazon-Canada;;
Sports;;red;White
Sportsnet;https://www.sportsnet.ca/;;
ESPN;https://www.espn.com/;;
Halifax_Airport;https://halifaxstanfield.ca/;;
S;;;
Halifax_Airport_Twitter;https://twitter.com/HfxStanfield;;
S;;;
TOOLS;;gray;black
CHARMAP_CALC_NOTEPAD;charmap;calc;notepad
Windows_RECOVERY;rstrui;;
)
;---------------------
loop,parse,sectx,`n,`r
{
x:=a_loopfield
if x=
break
stringsplit,k,x,`;
col1 .= k1 . s
col2 .= k2 . s
col3 .= k3 . s
col4 .= k4 . s
}
stringsplit,q,col1,%s%
stringsplit,m,col2,%s%
stringsplit,n,col3,%s%
stringsplit,o,col4,%s%
;-----------------------
totx:=(q0-1)
x:= (wa*1)/xx ,y:= (ha*1)/xx, w:= (wa*13 )/xx,h:= (ha*2.5)/xx,v:=(ha*3)/xx ;- button x y w h v=distance vertical
i=0
vert:=13 ;-- change here how many vertikal buttons want have ( inclusive SPACE or TITLE )
;------------------------------
Loop,%totx%
{
i++
BTName := q%i%
column2:= m%i%
column3:= n%i%
column4:= o%i%
if (btname="S")
Gui,2:Add,Text, x%x% y%y% w%w% h%h% center, ;- add space
;-----------------
else if column2= ;- add title and background-color and text-color
{
{
Gui,2:font,s%size1% italic,%font1%
Gui,2:Add,Progress, x%x% y%y% w%w% h%h% Disabled Background%column3% ;- Button-color
Gui,2:Add,Text, xp yp wp hp c%column4% BackgroundTrans Center 0x200 gStart1 v%btname%_%i% ,%btname%
}
}
else
{
;---------------------------
;- after TITLE > other buttons color background and text
;---
color=C8D0D4
;color=teal
text=Black
;text=yellow
;---
Gui,2:font,s%size2% norm,%font2%
Gui,2:Add,Progress, x%x% y%y% w%w% h%h% Disabled Background%color%
Gui,2:Add,Text, xp yp wp hp c%text% BackgroundTrans Center 0x200 gStart1 v%btname%_%i% ,%btname%
;---
;- normal button :
;Gui,2: Add, Button, x%x% y%y% w%w% h%h% gStart1 v%btname%_%i% ,%btname%
;---------------------------
}
y+=%v%
Md:=mod(i,vert)
if md=0
x+=(wa*14)/xx,y:=(ha*1)/xx ;- if modulo = 0 them move to new x (right) y (top)
}
;---------
x:=(wa*.25)/xx,y:=(ha*.30)/xx,w:=(wa*43)/xx,h:=(ha*41)/xx ;- GUI x y w h
Gui,2:Show, x%x% y%y% h%h% w%w%,%name1%
return
;-------------------------------------------------------------------------
2Guiclose:
exitapp
;-------------------------------------------------------------------------
;--------------- start --------------------------
start1:
gui,2:submit,nohide
Mousegetpos,,,,Ctrl ;- Button1
r:= a_guicontrol ;- vVar ( Buttonname )
stringtrimleft,ct,ctrl,6 ;- Button-(1)
clm2:= m%ct%
clm3:= n%ct%
clm4:= o%ct%
;msgbox, 262208, ,R=%r%`nCT=%ct%`nCTRL=%ctrl%`nURL1=%clm2%`nURL2=%clm3%
try
run,%clm2%
try
run,%clm3%
try
run,%clm4%
;- Gui,2:minimize
return
;=================== END SCRIPT =============================================
2nd-Example : different colors for buttons AFTER the TITLE
example TOOLS , the next 2 buttons AFTER TITLE-BUTTON "Tools" have defined color ( all TITLE-buttons are red )
Code: Select all
S;;;
TOOLS;;D5D1C9;black
CHARMAP_CALC_NOTEPAD;charmap;calc;notepad
Windows_RECOVERY;rstrui;;
Code: Select all
;-------- saved at 星期四 十一月 2021-11-04 10:14 UTC --------------
;- Add another column
;- https://www.autohotkey.com/boards/viewtopic.php?f=76&t=94674
;-- Date-modified =20211104/2 different colors for BUTTONS after TITLE
;-- Date-modified =20210917/3 csv Halifax / TITLE-button has another color / +Resize
;-- Date-modified =20210917/2 add TITLE or SPACE between buttons
;-- Date-modified =20210915 color buttons
;-- Date-modified =20210914 one button starts 2 URL's or programs
;--
#warn
#NoEnv
#Singleinstance,force
name1=TEST
setworkingdir,%a_scriptdir%
Gui,2:default
Gui,2: -DPIScale +Resize
transform,s,chr,127 ;- delimiter for stringsplit
WA:=A_screenwidth,HA:=A_screenheight,xx:=100
;Gui,2:Color,C8D0D4,Black ;-gray
Gui,2:Color,Black,Black
;-
;- I don't know which is the best font-size depending screen-size or scaling
;------------------------------
;-- maybe change FONT and FONTSIZE
font1=Lucida console ;- TITLE
size1=15
font2=times new roman ;- the other buttons
size2=13
;------------------------------
;--------------------
col1:=""
col2:=""
col3:=""
col4:=""
;--------------------- NAME - URL1 - URL2 - URL3 ----------------------------------------------------
;- BUTTONS : S=space / TITLE= if column-2 empty > BUTTON-BackgroundColor and Textcolor -------------
;-
sectx=
(Ltrim comments Join`r`n %
Halifax_Retales;;B7E5B0;Black
Halifax_Retales_Facebook;https://www.facebook.com/HalifaxReTales;;
Halifax_Retales_Chat;https://www.facebook.com/groups/HalifaxReTalesChat/?fref=mentions;;
Halifax_Retales_Twitter;https://twitter.com/HalifaxReTales;;
S;;;
Weather;;F7B900;black
Weather_Network;https://www.theweathernetwork.com/ca/weather/nova-scotia/halifax;;
National_Hurricane_Center;https://www.nhc.noaa.gov/?atl;;
Canada_Hurricane_Center;https://weather.gc.ca/hurricane/track_e.html;;
S;;;
Utilities;;C8D0D4;Black
Bell_Aliant;https://mybell.bell.ca/Login?TYPE=33554433&REALMOID=06-000db269-81bc-1874-88d4-791a8e75d0dd&GUID=&SMAUTHREASON=0&METHOD=GET&SMAGENTNAME=-SM-QKP7nnHXh2qXJfMWInHziJlTBdI9C7eOEOJRmIO63Oa%2fimktrTgbipB8hCBdh8Ey&TARGET=-SM-HTTPS%3a%2f%2fmybell%2ebell%2eca%2fMobility%3fAcctNo%3d8D711C5DA4B3704F0A5FE8ED0DB141225B124765045364C13F3345E0CA9697EBA72FAFBE86087BF101511830FD449071%26SubNo%3d13180274;;
NS_Power;https://myaccount.nspower.ca/;;
News;;YELLOW;Black
Chronicle_Herald;https://www.thechronicleherald.ca/;;
Global_News;https://globalnews.ca/halifax/;;
Halifax_Today;https://www.halifaxtoday.ca/;;
NY_Post;https://nypost.com/;;
Las_Vegas_Sun;https://lasvegassun.com/;;
CNN_News;https://www.cnn.com/;;
S;;;
TV_Guide;https://www.tvtv.ca/ns/halifax/lu4663D;;
TD_Bank;https://authentication.td.com/uap-ui/index.html?consumer=easyweb&locale=en_CA#/login/easyweb-getting-started;;
S;;;
Amazon_Canada;https://www.amazon.ca/;;
Amazon_Canada_Phone;https://gethuman.com/phone-number/Amazon-Canada;;
Sports;;CBA06A;Black
Sportsnet;https://www.sportsnet.ca/;;
ESPN;https://www.espn.com/;;
Halifax_Airport;https://halifaxstanfield.ca/;;
S;;;
Halifax_Airport_Twitter;https://twitter.com/HfxStanfield;;
S;;;
TOOLS;;D5D1C9;black
CHARMAP_CALC_NOTEPAD;charmap;calc;notepad
Windows_RECOVERY;rstrui;;
)
;---------------------
loop,parse,sectx,`n,`r
{
x:=a_loopfield
if x=
break
stringsplit,k,x,`;
col1 .= k1 . s
col2 .= k2 . s
col3 .= k3 . s
col4 .= k4 . s
}
stringsplit,q,col1,%s%
stringsplit,m,col2,%s%
stringsplit,n,col3,%s%
stringsplit,o,col4,%s%
;-----------------------
totx:=(q0-1)
x:= (wa*1)/xx ,y:= (ha*1)/xx, w:= (wa*13 )/xx,h:= (ha*2.5)/xx,v:=(ha*3)/xx ;- button x y w h v=distance vertical
i=0
vert:=13 ;-- change here how many vertikal buttons want have ( inclusive SPACE or TITLE )
;------------------------------
Loop,%totx%
{
i++
BTName := q%i%
column2:= m%i%
;column3:= n%i%
;column4:= o%i%
if (btname="S")
Gui,2:Add,Text, x%x% y%y% w%w% h%h% center, ;- add space
;-----------------
else if column2= ;- add title and background-color and text-color
{
{
Gui,2:font,s%size1% italic,%font1%
Gui,2:Add,Progress, x%x% y%y% w%w% h%h% Disabled BackgroundRED ;- Button-color
Gui,2:Add,Text, xp yp wp hp cWHITE BackgroundTrans Center 0x200 gStart1 v%btname%_%i% ,%btname%
column3:= n%i%
column4:= o%i%
}
}
else
{
;---------------------------
;- after TITLE > other buttons color background and text
;---
;color=C8D0D4
;color=teal
;text=Black
;text=yellow
;---
Gui,2:font,s%size2% norm,%font2%
Gui,2:Add,Progress, x%x% y%y% w%w% h%h% Disabled Background%column3%
Gui,2:Add,Text, xp yp wp hp c%column4% BackgroundTrans Center 0x200 gStart1 v%btname%_%i% ,%btname%
;---
;- normal button :
;Gui,2: Add, Button, x%x% y%y% w%w% h%h% gStart1 v%btname%_%i% ,%btname%
;---------------------------
}
y+=%v%
Md:=mod(i,vert)
if md=0
x+=(wa*14)/xx,y:=(ha*1)/xx ;- if modulo = 0 them move to new x (right) y (top)
}
;---------
x:=(wa*.25)/xx,y:=(ha*.30)/xx,w:=(wa*43)/xx,h:=(ha*41)/xx ;- GUI x y w h
Gui,2:Show, x%x% y%y% h%h% w%w%,%name1%
return
;-------------------------------------------------------------------------
2Guiclose:
exitapp
;-------------------------------------------------------------------------
;--------------- start --------------------------
start1:
gui,2:submit,nohide
Mousegetpos,,,,Ctrl ;- Button1
r:= a_guicontrol ;- vVar ( Buttonname )
stringtrimleft,ct,ctrl,6 ;- Button-(1)
clm2:= m%ct%
clm3:= n%ct%
clm4:= o%ct%
;msgbox, 262208, ,R=%r%`nCT=%ct%`nCTRL=%ctrl%`nURL1=%clm2%`nURL2=%clm3%
try
run,%clm2%
try
run,%clm3%
try
run,%clm4%
;- Gui,2:minimize
return
;=================== END SCRIPT =============================================
Re: Add another column
@garry. Little bit confused but after putting in your example tools title is red as it should be but the notepad background is blue and text is yellow. The same as the rest of my bookmarks. How do I change the background color to say amber ant the text to black or some other color I choose?Tk's
Re: Add another column
@garry. Please cancel out prevoius post. I didn't copy all script. Working now. Just need to change colors if necessary. If Bookmark has no title can I still change color?IE TV Guide. Tk's again for your help.
Re: Add another column
change color of buttons after TITLE or after SPACE ( if it has no TITLE )
Code: Select all
;-------- saved at 星期四 十一月 2021-11-04 14:32 UTC --------------
;- Add another column - Page 3
;- https://www.autohotkey.com/boards/viewtopic.php?f=76&t=94674&start=40
;-- Date-modified =20211104/3 different colors for BUTTONS after TITLE or SPACE
;-- Date-modified =20210917/3 csv Halifax / TITLE-button has another color / +Resize
;-- Date-modified =20210917/2 add TITLE or SPACE between buttons
;-- Date-modified =20210915 color buttons
;-- Date-modified =20210914 one button starts 3 URL's or programs
;--
#warn
#NoEnv
#Singleinstance,force
name1=TEST
setworkingdir,%a_scriptdir%
Gui,2:default
Gui,2: -DPIScale +Resize
transform,s,chr,127 ;- delimiter for stringsplit
WA:=A_screenwidth,HA:=A_screenheight,xx:=100
;Gui,2:Color,C8D0D4,Black ;-gray
Gui,2:Color,Black,Black
;-
;- I don't know which is the best font-size depending screen-size or scaling
;------------------------------
;-- maybe change FONT and FONTSIZE
font1=Lucida console ;- #TITLE
size1=15
font2=Lucida sans unicode ;- the other buttons
size2=13
;------------------------------
;--------------------
col1:=""
col2:=""
col3:=""
col4:=""
;--------------------- NAME - URL1 - URL2 - URL3 ----------------------------------------------------
;- BUTTONS : if _S (space) or #TITLE => change BUTTON-BackgroundColor and Textcolor -------------
;- note : if after _S (space) no #TITLE then must color be defined
;-
sectx=
(Ltrim comments Join`r`n %
#Halifax_Retales;;B7E5B0;Black
Halifax_Retales_Facebook;https://www.facebook.com/HalifaxReTales;;
Halifax_Retales_Chat;https://www.facebook.com/groups/HalifaxReTalesChat/?fref=mentions;;
Halifax_Retales_Twitter;https://twitter.com/HalifaxReTales;;
_S;;;
#Weather;;F7B900;black
Weather_Network;https://www.theweathernetwork.com/ca/weather/nova-scotia/halifax;;
National_Hurricane_Center;https://www.nhc.noaa.gov/?atl;;
Canada_Hurricane_Center;https://weather.gc.ca/hurricane/track_e.html;;
_S;;;
#Utilities;;C8D0D4;Black
Bell_Aliant;https://mybell.bell.ca/Login?TYPE=33554433&REALMOID=06-000db269-81bc-1874-88d4-791a8e75d0dd&GUID=&SMAUTHREASON=0&METHOD=GET&SMAGENTNAME=-SM-QKP7nnHXh2qXJfMWInHziJlTBdI9C7eOEOJRmIO63Oa%2fimktrTgbipB8hCBdh8Ey&TARGET=-SM-HTTPS%3a%2f%2fmybell%2ebell%2eca%2fMobility%3fAcctNo%3d8D711C5DA4B3704F0A5FE8ED0DB141225B124765045364C13F3345E0CA9697EBA72FAFBE86087BF101511830FD449071%26SubNo%3d13180274;;
NS_Power;https://myaccount.nspower.ca/;;
#News;;YELLOW;Black
Chronicle_Herald;https://www.thechronicleherald.ca/;;
Global_News;https://globalnews.ca/halifax/;;
Halifax_Today;https://www.halifaxtoday.ca/;;
NY_Post;https://nypost.com/;;
Las_Vegas_Sun;https://lasvegassun.com/;;
CNN_News;https://www.cnn.com/;;
_S;;gray;yellow
TV_Guide;https://www.tvtv.ca/ns/halifax/lu4663D;;
TD_Bank;https://authentication.td.com/uap-ui/index.html?consumer=easyweb&locale=en_CA#/login/easyweb-getting-started;;
_S;;1000B5;white
Amazon_Canada;https://www.amazon.ca/;;
Amazon_Canada_Phone;https://gethuman.com/phone-number/Amazon-Canada;;
#Sports;;CBA06A;Black
Sportsnet;https://www.sportsnet.ca/;;
ESPN;https://www.espn.com/;;
Halifax_Airport;https://halifaxstanfield.ca/;;
_S;;green;white
Halifax_Airport_Twitter;https://twitter.com/HfxStanfield;;
_S;;;
#TOOLS;;D5D1C9;black
CHARMAP_CALC_NOTEPAD;charmap;calc;notepad
Windows_RECOVERY;rstrui;;
)
;---------------------
loop,parse,sectx,`n,`r
{
x:=a_loopfield
if x=
break
stringsplit,k,x,`;
col1 .= k1 . s
col2 .= k2 . s
col3 .= k3 . s
col4 .= k4 . s
}
stringsplit,q,col1,%s%
stringsplit,m,col2,%s%
stringsplit,n,col3,%s%
stringsplit,o,col4,%s%
;-----------------------
totx:=(q0-1)
x:= (wa*1)/xx ,y:= (ha*1)/xx, w:= (wa*13 )/xx,h:= (ha*2.5)/xx,v:=(ha*3)/xx ;- button x y w h v=distance vertical
i=0
vert:=13 ;-- change here how many vertikal buttons want have ( inclusive SPACE and #TITLE )
;------------------------------
Loop,%totx%
{
i++
BTName := q%i%
column2:= m%i%
if (btname="_S")
{
Gui,2:Add,Text, x%x% y%y% w%w% h%h% center, ;- add space
column3:= n%i%
column4:= o%i%
}
;-----------------
else if (column2="" and btname !="_S") ;- add title and background-colorRED and text-colorWHITE
{
{
Gui,2:font,s%size1% norm,%font1%
Gui,2:Add,Progress, x%x% y%y% w%w% h%h% Disabled BackgroundRED ;- Button-color
Gui,2:Add,Text, xp yp wp hp cWHITE BackgroundTrans Center 0x200 gStart1 v%btname%_%i% ,%btname%
column3:= n%i%
column4:= o%i%
}
}
else
{
;---------------------------
;- after TITLE or SPACE > other buttons color background and text
;---
Gui,2:font,s%size2% italic,%font2%
Gui,2:Add,Progress, x%x% y%y% w%w% h%h% Disabled Background%column3%
Gui,2:Add,Text, xp yp wp hp c%column4% BackgroundTrans Center 0x200 gStart1 v%btname%_%i% ,%btname%
;---
;- normal button :
;Gui,2: Add, Button, x%x% y%y% w%w% h%h% gStart1 v%btname%_%i% ,%btname%
;---------------------------
}
y+=%v%
Md:=mod(i,vert)
if md=0
x+=(wa*14)/xx,y:=(ha*1)/xx ;- if modulo = 0 them move to new x (right) y (top)
}
;---------
x:=(wa*.25)/xx,y:=(ha*.30)/xx,w:=(wa*43)/xx,h:=(ha*41)/xx ;- GUI x y w h
Gui,2:Show, x%x% y%y% h%h% w%w%,%name1%
return
;-------------------------------------------------------------------------
2Guiclose:
exitapp
;-------------------------------------------------------------------------
;--------------- start --------------------------
start1:
gui,2:submit,nohide
Mousegetpos,,,,Ctrl ;- Button1
r:= a_guicontrol ;- vVar ( Buttonname )
stringtrimleft,ct,ctrl,6 ;- Button-(1)
clm2:= m%ct%
clm3:= n%ct%
clm4:= o%ct%
;msgbox, 262208, ,R=%r%`nCT=%ct%`nCTRL=%ctrl%`nURL1=%clm2%`nURL2=%clm3%
try
run,%clm2%
try
run,%clm3%
try
run,%clm4%
;- Gui,2:minimize
return
;=================== END SCRIPT =============================================
Re: Add another column
@garry. Thank you very much. Work's like a charm. Cheer's
Re: Add another column
@garry. Just curious but is it possible to change font size of an individual item. IE TV guide to say size 14 or Ahk forums,etc. Once again thanks for all your help Garry.
Re: Add another column
added > different fonts and font-size for buttons
Code: Select all
;-------- saved at 星期六 十一月 2021-11-06 17:03 UTC --------------
;- Add another column - Page 3
;- https://www.autohotkey.com/boards/viewtopic.php?f=76&t=94674&start=40
;-- Date-modified =20211106 different fonts and size for buttons / TITLE begins with '#'
;-- Date-modified =20211104/3 different colors for BUTTONS after TITLE or SPACE
;-- Date-modified =20210917/3 csv Halifax / TITLE-button has another color / +Resize
;-- Date-modified =20210917/2 add TITLE or SPACE between buttons
;-- Date-modified =20210915 color buttons
;-- Date-modified =20210914 one button starts 3 URL's or programs
;--
#warn
#NoEnv
#Singleinstance,force
name1=TEST COLOR BUTTONS
setworkingdir,%a_scriptdir%
Gui,2:default
Gui,2: -DPIScale +Resize
transform,s,chr,127 ;- delimiter for stringsplit
WA:=A_screenwidth,HA:=A_screenheight,xx:=100
;Gui,2:Color,C8D0D4,Black ;-gray
Gui,2:Color,Black,Black
;--------------------
col1:="",col2:="",col3:="",col4:=""
vert:=13 ;-- change here how many vertikal buttons want have ( inclusive SPACE and #TITLE )
; but then also change GuiSize ( Width and Height )
;--------------------
;-
;- I don't know which is the best font-size depending screen-size or scaling
;------ BUTTON-TITLE ---------------
;-- maybe change FONT and FONTSIZE
FontTitle:="Trebuchet MS"
SizeTitle:="16 norm bold"
colbgr:="red"
coltxt:="white"
;----------------------------------
;--------------------- NAME - URL1 - URL2 - URL3 ----------------------------------------------------
;- BUTTONS : if _S (empty place) or #TITLE => change BUTTON-BackgroundColor and Textcolor and Color/Size/Font -------------
;- note : if after _S (empty place) no #TITLE then must Color/Size/Font be defined
;-
;- examples :
;- #Weather;13 italic|Arial ;F7B900;Black > followed buttons after TITLE > size=13 italic Font=Arial Button-Background=F7B900 Text=Black
;- #News ;13 norm |Trebuchet MS;YELLOW;Black > followed buttons after TITLE > size=13 norm Font=Trebuchet Button-Background=Yellow Text=Black
;- _S ;17 bold |Verdana ;Gray ;Yellow > followed buttons after empty TEXT > size=17 bold Font=Verdana Button-Background=Gray Text=Yellow
;-
;-
sectx=
(Ltrim comments Join`r`n %
#Halifax_Retales;17 norm|Trebuchet MS;B7E5B0;Black
Halifax_Retales_Facebook;https://www.facebook.com/HalifaxReTales;;
Halifax_Retales_Chat;https://www.facebook.com/groups/HalifaxReTalesChat/?fref=mentions;;
Halifax_Retales_Twitter;https://twitter.com/HalifaxReTales;;
_S;;;
#Weather;13 italic|Arial;F7B900;black
Weather_Network;https://www.theweathernetwork.com/ca/weather/nova-scotia/halifax;;
National_Hurricane_Center;https://www.nhc.noaa.gov/?atl;;
Canada_Hurricane_Center;https://weather.gc.ca/hurricane/track_e.html;;
_S;;;
#Utilities;17 norm|Verdana;C8D0D4;Black
Bell_Aliant;https://mybell.bell.ca/Login?TYPE=33554433&REALMOID=06-000db269-81bc-1874-88d4-791a8e75d0dd&GUID=&SMAUTHREASON=0&METHOD=GET&SMAGENTNAME=-SM-QKP7nnHXh2qXJfMWInHziJlTBdI9C7eOEOJRmIO63Oa%2fimktrTgbipB8hCBdh8Ey&TARGET=-SM-HTTPS%3a%2f%2fmybell%2ebell%2eca%2fMobility%3fAcctNo%3d8D711C5DA4B3704F0A5FE8ED0DB141225B124765045364C13F3345E0CA9697EBA72FAFBE86087BF101511830FD449071%26SubNo%3d13180274;;
NS_Power;https://myaccount.nspower.ca/;;
#News;13 norm|Trebuchet MS;YELLOW;Black
Chronicle_Herald;https://www.thechronicleherald.ca/;;
Global_News;https://globalnews.ca/halifax/;;
Halifax_Today;https://www.halifaxtoday.ca/;;
NY_Post;https://nypost.com/;;
Las_Vegas_Sun;https://lasvegassun.com/;;
CNN_News;https://www.cnn.com/;;
_S;17 bold|Verdana;gray;yellow
TV_Guide;https://www.tvtv.ca/ns/halifax/lu4663D;;
TD_Bank;https://authentication.td.com/uap-ui/index.html?consumer=easyweb&locale=en_CA#/login/easyweb-getting-started;;
_S;13 italic|Trebuchet MS;1000B5;white
Amazon_Canada;https://www.amazon.ca/;;
Amazon_Canada_Phone;https://gethuman.com/phone-number/Amazon-Canada;;
#Sports;17 norm|Verdana;CBA06A;Black
Sportsnet;https://www.sportsnet.ca/;;
ESPN;https://www.espn.com/;;
Halifax_Airport;https://halifaxstanfield.ca/;;
_S;13 italic|Trebuchet MS;green;white
Halifax_Airport_Twitter;https://twitter.com/HfxStanfield;;
_S;;;
#TOOLS;11 norm|Verdana;D5D1C9;black
CHARMAP_CALC_NOTEPAD;charmap;calc;notepad
Windows_RECOVERY;rstrui;;
)
;---------------------
loop,parse,sectx,`n,`r
{
x:=a_loopfield
if x=
break
stringsplit,k,x,`;
col1 .= k1 . s
col2 .= k2 . s
col3 .= k3 . s
col4 .= k4 . s
}
stringsplit,q,col1,%s%
stringsplit,m,col2,%s%
stringsplit,n,col3,%s%
stringsplit,o,col4,%s%
;-----------------------
totx:=(q0-1)
x:= (wa*1)/xx ,y:= (ha*1)/xx, w:= (wa*13 )/xx,h:= (ha*2.5)/xx,v:=(ha*3)/xx ;- button x y w h v=distance vertical
i=0
;------------------------------
Loop,%totx%
{
i++
BTName := q%i%
column2:= m%i%
stringmid,BTN,BTName,1,1
if (btname="_S")
{
Gui,2:Add,Text, x%x% y%y% w%w% h%h% center, ;- if space added
column2:=m%i%
stringsplit,z,column2,`|
column3:= n%i%
column4:= o%i%
}
;-----------------
else if (BTN="#")
{
{
Gui,2:font,s%SizeTitle% ,%FontTitle%
Gui,2:Add,Progress, x%x% y%y% w%w% h%h% Disabled Background%colbgr% ;- TITLE Button-backgroundcolor
Gui,2:Add,Text, xp yp wp hp c%coltxt% BackgroundTrans Center 0x200 gStart1 v%btname%_%i% ,%btname%
column2:=m%i%
stringsplit,z,column2,`|
column3:= n%i%
column4:= o%i%
}
}
else
{
;---------------------------
;- after TITLE or SPACE > other buttons color background and text
;---
Gui,2:font,s%z1%,%z2%
Gui,2:Add,Progress, x%x% y%y% w%w% h%h% Disabled Background%column3%
Gui,2:Add,Text, xp yp wp hp c%column4% BackgroundTrans Center 0x200 gStart1 v%btname%_%i% ,%btname%
;---------------------------
}
y+=%v%
Md:=mod(i,vert)
if md=0
x+=(wa*14)/xx,y:=(ha*1)/xx ;- if modulo = 0 them move to new x (right) y (top)
}
;--------- GUISIZE -------------------------------------------------------
x:=(wa*.25)/xx,y:=(ha*.30)/xx,w:=(wa*43)/xx,h:=(ha*41)/xx ;- GUI x y w h
Gui,2:Show, x%x% y%y% h%h% w%w%,%name1%
return
;-------------------------------------------------------------------------
2Guiclose:
exitapp
;-------------------------------------------------------------------------
;--------------- start --------------------------
start1:
gui,2:submit,nohide
Mousegetpos,,,,Ctrl ;- Button1
r:= a_guicontrol ;- vVar ( Buttonname )
stringmid,btnx,r,1,1
if (btnx="#")
return
stringtrimleft,ct,ctrl,6 ;- Button-(1)
clm2:= m%ct%
clm3:= n%ct%
clm4:= o%ct%
;msgbox, 262208, ,R=%r%`nCT=%ct%`nCTRL=%ctrl%`nURL1=%clm2%`nURL2=%clm3%`nURL3=%clm4%
try
run,%clm2%
try
run,%clm3%
try
run,%clm4%
;- Gui,2:minimize
return
;=================== END SCRIPT =============================================
Re: Add another column
@garry. Thank you so garry. This is perfect. Learning more and more everyday. Cheer's.
Re: Add another column
@garry. Just wanted to thank you again Garry. I will assume that in order for all this to work I have to keep the # sign in front of the titles?
Re: Add another column
yes, but if you don't want it , I can change the scriptI will assume that in order for all this to work I have to keep the # sign in front of the titles?
Re: Add another column
@garry. I don't really need it Garry. But if you direct me on what to do maybe I can figure it out on my own. I do appreciate all the help you have given me.
Re: Add another column
not needed add # for title,Font/Color definitions are in column3
LAST EDIT : added 3 ahk test scripts to the last buttons
LAST EDIT : added 3 ahk test scripts to the last buttons
Code: Select all
;- Add another column - Page 3
;- https://www.autohotkey.com/boards/viewtopic.php?f=76&t=94674&start=40
;-- Date-modified =20211229 added 3 ahk test scripts to the last buttons
;-- Date-modified =20211226 add a hotkey F9 to send #{tab} and a ahk-testcript
;-- Date-modified =20211107 not needed add # for title,Font/Color definitions are in column3
;-- Date-modified =20211106 different fonts and size for buttons
;-- Date-modified =20211104/3 different colors for BUTTONS after TITLE or SPACE
;-- Date-modified =20210917/3 csv Halifax / TITLE-button has another color / +Resize
;-- Date-modified =20210917/2 add TITLE or SPACE between buttons
;-- Date-modified =20210915 color buttons
;-- Date-modified =20210914 one button starts 3 URL's or programs
;--------------------------------------------------------------------------------
#warn
#NoEnv
#Singleinstance,force
name1=TEST COLOR BUTTONS_6
setworkingdir,%a_scriptdir%
Settitlematchmode,2
Gui,2:default
Gui,2: -DPIScale +Resize +Alwaysontop
transform,s,chr,127 ;- delimiter for stringsplit
WA:=A_screenwidth,HA:=A_screenheight,xx:=100
;Gui,2:Color,C8D0D4,Black ;-gray
Gui,2:Color,Black,Black
;=======================================================
;-------------------- a hotkey for test ----------------
hotkey, IfWinActive,TEST COLOR BUTTONS_6 ahk_class AutoHotkeyGUI ;- this script see var %name1%
hotkey, ~F9, send1
hotkey, IfWinActive,
;-------- programs for test ( see last 3-buttons ) -------------------------------
Script1=%a_scriptdir%\Send_2Firefox_TAB.ahk
Script2=%a_scriptdir%\Send_2Your_Phone_RAlt.ahk
Script3=%a_scriptdir%\Send_2TVShowTracker.ahk
;-------
sc:="ahk_exe firefox.exe"
ifnotexist,%script1%
{
ex1=
(Ltrim,join`r`n
#IfWinExist,("ahk_class MozillaWindowClass")
IfWinNotActive ,%sc%,,WinActivate,%sc%
WinWaitActive,%sc%
sleep,500
;ControlSend,ahk_parent,#{Tab},%sc%
send,#{tab}
#IfWinExist
return
)
fileappend,%ex1%`r`n,%script1%,utf-8
ex1=
}
;-------
ifnotexist,%script2%
{
ex2=
(
Send,{RAlt}
return
)
fileappend,%ex2%`r`n,%script2%,utf-8
ex2=
}
;-------
ifnotexist,%script3%
{
ex3=
(
Send,SC038
return
)
fileappend,%ex3%`r`n,%script3%,utf-8
ex3=
}
;===============================================
;--------------------
col1:="",col2:="",col3:="",col4:=""
vert:=13 ;-- change here how many vertikal buttons want have ( inclusive EMPTY-LINE and TITLE )
; but then also change GuiSize ( Width and Height )
;--------------------
;-
;- I don't know which is the best font-size depending screen-size or scaling
;------ BUTTON-TITLE ---------------
FontTitle:="Trebuchet MS" ,SizeTitle:="16 norm bold",colbgr:="red",coltxt:="white"
;----------------------------------
;--------------------- Button-NAME - URL1 - URL2 - URL3 ----------------------------------------------------
;- if Column-2 is empty :
;- Halifax_Retales;;17 norm|Trebuchet MS|B7E5B0|Black; ;<<< example FONT/colors after TITLE ,Column-2 is empty, all definitions are in Column-3 : FontSize|FONT|BackGroundColor|TextColor
;-
;- _S;;17 bold|Verdana|gray|yellow; ;<<< example FONT/colors after EMPTY-LINE
;- TV_Guide;https://www.tvtv.ca/ns/halifax/lu4663D;;
;-
;- TOOLS;;11 norm|Verdana|D5D1C9|black;
;- CHARMAP_CALC_NOTEPAD;charmap;calc;notepad ;-- run URL or program (1-3)
;------------------------------------------------------------------------------------------------------------
;-
sectx=
(Ltrim comments Join`r`n %
Halifax_Retales;;17 norm|Trebuchet MS|B7E5B0|Black;
Halifax_Retales_Facebook;https://www.facebook.com/HalifaxReTales;;
Halifax_Retales_Chat;https://www.facebook.com/groups/HalifaxReTalesChat/?fref=mentions;;
Halifax_Retales_Twitter;https://twitter.com/HalifaxReTales;;
_S;;;
Weather;;13 italic|Arial|F7B900|black;
Weather_Network;https://www.theweathernetwork.com/ca/weather/nova-scotia/halifax;;
National_Hurricane_Center;https://www.nhc.noaa.gov/?atl;;
Canada_Hurricane_Center;https://weather.gc.ca/hurricane/track_e.html;;
_S;;;
Utilities;;17 norm|Verdana|C8D0D4|Black;
Bell_Aliant;https://mybell.bell.ca/Login?TYPE=33554433&REALMOID=06-000db269-81bc-1874-88d4-791a8e75d0dd&GUID=&SMAUTHREASON=0&METHOD=GET&SMAGENTNAME=-SM-QKP7nnHXh2qXJfMWInHziJlTBdI9C7eOEOJRmIO63Oa%2fimktrTgbipB8hCBdh8Ey&TARGET=-SM-HTTPS%3a%2f%2fmybell%2ebell%2eca%2fMobility%3fAcctNo%3d8D711C5DA4B3704F0A5FE8ED0DB141225B124765045364C13F3345E0CA9697EBA72FAFBE86087BF101511830FD449071%26SubNo%3d13180274;;
NS_Power;https://myaccount.nspower.ca/;;
News;;13 norm|Trebuchet MS|YELLOW|Black;
Chronicle_Herald;https://www.thechronicleherald.ca/;;
Global_News;https://globalnews.ca/halifax/;;
Halifax_Today;https://www.halifaxtoday.ca/;;
NY_Post;https://nypost.com/;;
Las_Vegas_Sun;https://lasvegassun.com/;;
CNN_News;https://www.cnn.com/;;
_S;;17 bold|Verdana|gray|yellow;
TV_Guide;https://www.tvtv.ca/ns/halifax/lu4663D;;
TD_Bank;https://authentication.td.com/uap-ui/index.html?consumer=easyweb&locale=en_CA#/login/easyweb-getting-started;;
_S;;13 italic|Trebuchet MS|1000B5|white;
Amazon_Canada;https://www.amazon.ca/;;
Amazon_Canada_Phone;https://gethuman.com/phone-number/Amazon-Canada;;
Sports;;17 norm|Verdana|CBA06A|Black;
Sportsnet;https://www.sportsnet.ca/;;
ESPN;https://www.espn.com/;;
Halifax_Airport;https://halifaxstanfield.ca/;;
_S;;13 italic|Trebuchet MS|green|white;
Halifax_Airport_Twitter;https://twitter.com/HfxStanfield;;
_S;;;
TOOLS;;11 norm|Verdana|D5D1C9|black;
CHARMAP_CALC_NOTEPAD;charmap;calc;notepad
Windows_RECOVERY;rstrui;;
Send2Firefox;Send_2Firefox_TAB.ahk;;
Send2YourPhone;Send_2Your_Phone_RAlt.ahk;;
Send2TVShowTracker;Send_2TVShowTracker.ahk;;
)
;---------------------
loop,parse,sectx,`n,`r
{
x:=a_loopfield
if x=
break
stringsplit,k,x,`;
col1 .= k1 . s , col2 .= k2 . s , col3 .= k3 . s , col4 .= k4 . s
}
stringsplit,q,col1,%s%
stringsplit,m,col2,%s%
stringsplit,n,col3,%s%
stringsplit,o,col4,%s%
;-----------------------
i:=0,totx:=(q0-1),x:= (wa*1)/xx ,y:= (ha*1)/xx, w:= (wa*13 )/xx,h:= (ha*2.5)/xx,v:=(ha*3)/xx ;- button x y w h v=distance vertical
;------------------------------
Loop,%totx%
{
i++
BTName := q%i%
column2:= m%i%
if (btname="_S")
{
Gui,2:Add,Text, x%x% y%y% w%w% h%h% center, ;- if space added
column3:= n%i%, column4:= o%i%
stringsplit,z,column3,`|
}
;-----------------
else if (column2="" and btname !="_S") ;- add title and background-colorRED and text-colorWHITE
{
{
Gui,2:font,s%SizeTitle% ,%FontTitle%
Gui,2:Add,Progress, x%x% y%y% w%w% h%h% Disabled Background%colbgr% ;- TITLE Button-backgroundcolor
Gui,2:Add,Text, xp yp wp hp c%coltxt% BackgroundTrans Center 0x200 gStart1 v%btname%_%i% ,%btname%
column3:= n%i% , column4:= o%i%
stringsplit,z,column3,`|
}
}
else
{
;---------------------------
;- after TITLE or SPACE > other buttons color background and text
;---
Gui,2:font,s%z1%,%z2%
Gui,2:Add,Progress, x%x% y%y% w%w% h%h% Disabled Background%Z3%
Gui,2:Add,Text, xp yp wp hp c%Z4% BackgroundTrans Center 0x200 gStart1 v%btname%_%i% ,%btname%
;---------------------------
}
y+=%v%
Md:=mod(i,vert)
if md=0
x+=(wa*14)/xx,y:=(ha*1)/xx ;- if modulo = 0 them move to new x (right) y (top)
}
;--------- GUISIZE -------------------------------------------------------
x:=(wa*.25)/xx,y:=(ha*.30)/xx,w:=(wa*43)/xx,h:=(ha*41)/xx ;- GUI x y w h
Gui,2:Show, x%x% y%y% h%h% w%w%,%name1%
return
;-------------------------------------------------------------------------
2Guiclose:
exitapp
;-------------------------------------------------------------------------
send1:
send,#{tab}
return
;--------------- start --------------------------
start1:
gui,2:submit,nohide
Mousegetpos,,,,Ctrl ;- Button1
r:= a_guicontrol ;- vVar ( Buttonname )
stringtrimleft,ct,ctrl,6 ;- Button-(1)
clm2:= m%ct%,clm3:= n%ct%,clm4:= o%ct%
;msgbox, 262208, ,R=%r%`nCT=%ct%`nCTRL=%ctrl%`nURL1=%clm2%`nURL2=%clm3%`nURL3=%clm4%
Gui,2:minimize
try
run,%clm2%
try
run,%clm3%
try
run,%clm4%
;Gui,2:minimize
return
;=================== END SCRIPT =============================================
Last edited by garry on 29 Dec 2021, 07:53, edited 3 times in total.
Re: Add another column
@garry. Thanks Garry. At work right now. Will check when I get home.
Re: Add another column
@garry. Hi garry. First thank you very much for all the education you have given me on ahk. But I have just one last question. When I open The gui is it possible to have it close as soon as I click on a button? Ie as soon as I click weather network gui screen closes. If not no big deal. I can use a sleep timer. Thank's
Re: Add another column
... in the last example : > Gui,2:minimizeWhen I open the gui is it possible to have it close as soon as I click on a button?
this minimize the GUI or you can use also exitapp ( GUI closes ) , after clicked on button
Code: Select all
;....
;--------------- start --------------------------
start1:
gui,2:submit,nohide
Mousegetpos,,,,Ctrl ;- Button1
r:= a_guicontrol ;- vVar ( Buttonname )
stringtrimleft,ct,ctrl,6 ;- Button-(1)
clm2:= m%ct%,clm3:= n%ct%,clm4:= o%ct%
;msgbox, 262208, ,R=%r%`nCT=%ct%`nCTRL=%ctrl%`nURL1=%clm2%`nURL2=%clm3%`nURL3=%clm4%
try
run,%clm2%
try
run,%clm3%
try
run,%clm4%
Gui,2:minimize
return
;=================== END SCRIPT =============================================
Re: Add another column
@garry. Perfect Thank's so much again.
Re: Add another column
@garry. Hi all. First I hope you are having Happy Holidays. Just a quick question I have been playing with. I know websites I just put in the path just the same as with Apps. My question is can I send a command. IE Firefox;Send,#{Tab} or to send any command. If so how to do it. Thank you.
Re: Add another column
see last complete script above
added a hotkey F9 to send #{tab} and a ahk-testscript test1.ahk ( see last button AHK_msgbox )
added a hotkey F9 to send #{tab} and a ahk-testscript test1.ahk ( see last button AHK_msgbox )