Search found 31 matches
Re: A_NewLine
Yes, it would just be nice to have it predefined, like A_Space and A_Tab.
A_NewLine
Just a built-in variable to go with A_Space and A_Tab that would allow, instead of this:
...this:
Code: Select all
A_Clipboard := "Another" "`n"
. "Green" "`n"
. "World" "`n"
Code: Select all
A_Clipboard := "Another" A_NewLine
. "Green" A_NewLine
. "World" A_NewLine
- 21 Nov 2022, 11:25
- Forum: Ask for Help (v2)
- Topic: File Renaming with a_Index
- Replies: 0
- Views: 264
File Renaming with a_Index
This script renames all files in a folder as a prefix and a 3-digit serial number. s_Folder := DirSelect("*E:\" , 3 , "Select Folder:") s_Prefix := InputBox("Prefix: ").Value Loop Files , s_Folder "\*.*", "R" FileMove(a_LoopFileFullPath , a_LoopFileDir "\" s_Prefix " " Format("{:03}" , a_Index) "." ...
- 17 Nov 2022, 01:18
- Forum: Ask for Help (v2)
- Topic: RunWait doesn't wait (Beta-15)
- Replies: 3
- Views: 455
Re: RunWait doesn't wait (Beta-15)
Okay, found a workaround: DetectHiddenWindows True RunWait "Script 1.ahk" Sleep(5000) WinWaitClose("Script 1.ahk") RunWait "Script 2.ahk" Sleep(5000) WinWaitClose("Script 2.ahk") RunWait "Script 3.ahk" Sleep(5000) WinWaitClose("Script 2.ahk") ... But I think it'd be better to have a fixed RunWait.
- 17 Nov 2022, 01:10
- Forum: Ask for Help (v2)
- Topic: RunWait doesn't wait (Beta-15)
- Replies: 3
- Views: 455
RunWait doesn't wait (Beta-15)
I run a script to run a series of other scripts in sequence, like this: RunWait "Script 1.ahk" RunWait "Script 2.ahk" RunWait "Script 3.ahk" ... It worked fine under Beta-7, but under Beta-15, AHK doesn't wait for each to finish before starting the next one. Workarounds with WinWaitClose, ProcessWai...
- 14 Nov 2022, 05:29
- Forum: Ask for Help (v2)
- Topic: Arrays mistaken as strings?
- Replies: 4
- Views: 1541
Re: Arrays mistaken as strings?
God I'm stupid sometimes. . In this case I do need to generate the two arrays separately, but returning the second does indeed solve the problem. Thank you.
- 14 Nov 2022, 03:27
- Forum: Ask for Help (v2)
- Topic: Arrays mistaken as strings?
- Replies: 4
- Views: 1541
Arrays mistaken as strings?
This script should count the files in a folder, then count those from that list how many are .txt files. Except it doesn't work - I get the error "This value of type 'String' has no property named 'Length'" in line 3. The problem seems to be that what are defined as arrays in functions mysteriously ...
- 13 Jan 2022, 10:26
- Forum: Ask for Help (v2)
- Topic: SetTimer vs Loop
- Replies: 1
- Views: 679
SetTimer vs Loop
This script puts a timestamp at the base of the screen. I use it when screencasting. o_Clock := Gui("" , "Clock") o_Clock.Opt("-Caption AlwaysOnTop") o_Clock.MarginX := 0 o_Clock.MarginY := 0 o_Clock.Add("Text" , "Background000000 cFFFF80 H40 w640 Center" , "").SetFont("s24") o_Clock.Show("X1280 Y10...
- 07 Dec 2021, 10:04
- Forum: Ask for Help (v2)
- Topic: ControlSetText for Pictures
- Replies: 1
- Views: 478
ControlSetText for Pictures
I'm trying to program a simple slideshow. Here's the code: o_SlideShow := Gui("" , "SlideShow") o_SlideShow.Add("Picture" , "Center W1280 H-1" , "") o_SlideShow.Show("") Loop { Loop Files , "E:\SlideShow\*.jpg" { ControlSetText(a_LoopFileFullPath , "Picture1" , "SlideShow") Sleep(1000) } } I get the...
- 04 Sep 2021, 18:06
- Forum: Ask for Help (v2)
- Topic: Copy data between scripts?
- Replies: 15
- Views: 1446
Re: Copy data between scripts?
I've got it to work, and it was kind-of obvious all along. This is the receiving script, filename "Notify 1.ahk": MsgBox(a_Args[1] ", " a_Args[2] ", " a_Args[3]) And this is the sending script: Run("AutoHotKey64.exe `"Notify 1.ahk`" One 2 `"Hello World`"") You have to run the AHK .exe file, getting ...
- 04 Sep 2021, 12:13
- Forum: Ask for Help (v2)
- Topic: Copy data between scripts?
- Replies: 15
- Views: 1446
Re: Copy data between scripts?
This variation
also runs the second script, but still no parameters are received. So, the point about the quotes is noted, but I think it's a separate issue.
Code: Select all
Run(a_ScriptDir "\Notify.ahk Hello_World 5")
- 04 Sep 2021, 11:51
- Forum: Ask for Help (v2)
- Topic: Copy data between scripts?
- Replies: 15
- Views: 1446
Re: Copy data between scripts?
Sounds good, but something's wrong. Script one... Run(a_ScriptDir "\Notify.ahk 'Hello World' '5'") ...passes two parameters to script two... #SingleInstance o_Notify := Gui("" , "Notify") o_Notify.SetFont("s24") o_Notify.Add("Text" , "W640" , a_Args[1]) o_Notify.Show("X0 Y0 AutoSize") Sleep(1000 * a...
- 01 Sep 2021, 14:31
- Forum: Ask for Help (v2)
- Topic: Copy data between scripts?
- Replies: 15
- Views: 1446
Re: Copy data between scripts?
So, hardly ideal, but we can have this script: #SingleInstance o_Notify := Gui("" , "Notify") o_Notify.SetFont("s24") o_Notify.Add("Text" , "W640" , "") o_Notify.Show("X0 Y0 AutoSize") Sleep(1000 * 5) o_Notify.Destroy() ...run by this code in another script... Run(a_ScriptDir "\Notify.ahk") WinWaitA...
- 29 Aug 2021, 15:50
- Forum: Ask for Help (v2)
- Topic: Copy data between scripts?
- Replies: 15
- Views: 1446
Copy data between scripts?
How do I copy data from one script to another? Most of my scripts contain the following hotkey. Ctrl+Esc is an "emergency close" hotkey. ^Esc Up:: { FileAppend("Test Script Closing" , a_ScriptDir "\Notification.txt") Run(a_ScriptDir "\Display Notification.ahk") ExitApp } The "Display Notification" s...
- 22 May 2021, 19:42
- Forum: Bug Reports
- Topic: a135 misses some hotkeys
- Replies: 1
- Views: 637
a135 misses some hotkeys
a135 seems to not intercept some Win+X hotkeys. I use these to position windows around the screen: #1 Up:: WinMove -3 , 0 , 1280 , 720 , WinGetTitle("A") #2 Up:: WinMove -3 , 0 , 1280 , 1080 , WinGetTitle("A") #3 Up:: WinMove -3 , 0 , 1926 , 720 , WinGetTitle("A") #4 Up:: WinMove -3 , 0 , 1926 , 108...
- 08 Mar 2021, 11:07
- Forum: Ask for Help (v2)
- Topic: DateTime GUI
- Replies: 3
- Views: 671
Re: DateTime GUI
It's that simple? Thanks. I spent the day changing every _other_ bit of syntax. And coming up with this little workaround: s_DateStamp := f_DateStamp() f_DateStamp() { s_NowCopy := a_Now s_DateChange := InputBox("Schedule" , "" , "" , FormatTime(s_NowCopy , "yyyy") "/" . FormatTime(s_NowCopy , "MM")...
- 08 Mar 2021, 08:28
- Forum: Ask for Help (v2)
- Topic: DateTime GUI
- Replies: 3
- Views: 671
Re: DateTime GUI
This code, working in a123, allows the user to select a date stamp of month, day and hour. It's broken in a128, and I can't figure out how to update it. Can anyone help? s_DateStamp := f_DateStamp() f_DateStamp() { s_DateStamp := a_Now o_DateStamp := Gui.New("ToolWindow" , "Get Date Stamp") o_DateS...
- 14 Dec 2020, 07:01
- Forum: Ask for Help (v2)
- Topic: Screenshot Code
- Replies: 1
- Views: 354
Re: Screenshot Code
For screenshots, I use AHK to trigger IrfanView to take a screenshot. You can get the PortableApps version of IrfanView here: https portableapps.com /apps/graphics_pictures/irfanview_portable Broken Link for safety The script below assumes you've installed IrfanView to "C:\IrfanViewPortable\App\Irfa...
- 05 Oct 2020, 14:15
- Forum: Ask for Help (v2)
- Topic: Ignore/Retry after failure?
- Replies: 4
- Views: 736
Re: Ignore/Retry after failure?
For what it's worth, my problem seems to be that some URLs start with "http://"... and some start with "http:///". And while browsers can handle three slashes, it seems AHK's Download function can't. Why some wiki software occasionally slips in an extra slash, I've no idea. Maybe bad parsing of rela...
- 05 Oct 2020, 09:33
- Forum: Ask for Help (v2)
- Topic: Ignore/Retry after failure?
- Replies: 4
- Views: 736
Re: Ignore/Retry after failure?
When I say "Hang", I just mean I get the message "Error: Failed", an arrow pointing to the line Download(s_ImageLink , s_Path "\" s_Serial " - " s_Title "\" s_ImageName) ...and "The current thread will exit". Sometimes I know the reason for the error - the link is to an mp4 file, or to a bit of code...