Search found 1907 matches
- 29 Apr 2024, 12:12
- Forum: Ask for Help (v1)
- Topic: MsgBox and WinMove
- Replies: 29
- Views: 5933
Re: MsgBox and WinMove
Made some changes to the code: MsgBox, This MessageBox will appear in the centre of screen, as usual MsgBox,, |x50 y70, This MessageBox will appear in coords x = 50 y = 70 without a title. MsgBox,, Hello!|x500 y0, This MessageBox will appear in coords x = 500 y = 0 with the title "Hello!" Return CB...
- 25 Mar 2024, 16:35
- Forum: Ask for Help (v2)
- Topic: copy on one machine, paste on another machine...
- Replies: 5
- Views: 196
Re: copy on one machine, paste on another machine...
I can not install any software or even run new .exe on my work machine but it does have AHK :) so I can run scripts I often need to pass various text to my work machine from my other machine so I end up emailing it - takes time I know you said you cannot install any software but PowerToys by Micros...
- 18 Mar 2024, 20:02
- Forum: Ask for Help (v2)
- Topic: How to format a paragraph of MS WORD document Topic is solved
- Replies: 10
- Views: 294
Re: How to format a paragraph of MS WORD document Topic is solved
How to format a paragraph of MS WORD document, I want to format the last paragraph use the previous paragraph's font type and size. If you want to copy all the formatting from the paragraph above instead of just the font and size, you can do this: oWord := ComObjActive("Word.Application") f11:: { o...
- 18 Mar 2024, 19:43
- Forum: Ask for Help (v2)
- Topic: Variadic function with * as the final parameter (without a parameter name) Topic is solved
- Replies: 6
- Views: 177
Re: Variadic function with * as the final parameter (without a parameter name) Topic is solved
Maybe an example will help: testFunc(1,2,3,4,5,6) testFunc(a, b, *) ; all parameters passed after the first two are discarded { MsgBox a ' ' b } testFunc2(1,2,3,4,5,6) testFunc2(a, b, c*) ; all parameters passed after the first two are stored in the array c { MsgBox a ' ' b for stuff in c MsgBox stu...
- 18 Mar 2024, 17:43
- Forum: Ask for Help (v2)
- Topic: syntax for map Topic is solved
- Replies: 10
- Views: 384
Re: syntax for map Topic is solved
@teadrinker Was not aware of the use of * with maps. Thanks. It is more of * with any array in any function thing. * just 'expands' an array and tells a function that elements are to be treated as separate parameters resulting in a variadic function call. Arr := ['StringThing', 7, 6] Msgbox SubStr(...
- 14 Mar 2024, 13:59
- Forum: Ask for Help (v2)
- Topic: Overriding other app's window style without a flash
- Replies: 3
- Views: 164
Re: Overriding other app's window style without a flash
I see, then I guess I'd also need to implement all the logic inside that DLL file. Do you know whether it's actually possible, though, not to only apply styles, but update window size/position, and, crucially, do all that before a window is shown? Yes, the SetWinEventHookEx approach is doable, but ...
- 13 Mar 2024, 17:22
- Forum: Ask for Help (v2)
- Topic: Overriding other app's window style without a flash
- Replies: 3
- Views: 164
Re: Overriding other app's window style without a flash
Maybe somehow hook into the window creation instead of waiting for the window to be created and changing the styles later? You can hook into a AHK window before it is displayed but not another application's window before it opens without using a separate custom DLL file. It is the difference betwee...
- 23 Feb 2024, 19:22
- Forum: Ask for Help (v2)
- Topic: Open PDF using ComObject
- Replies: 8
- Views: 365
Re: Open PDF using ComObject
:*:yyyy:: { AcroApp := ComObject('AcroExch.App') AcroAVDoc_Active := AcroApp.GetActiveDoc() AcroPDDoc_Active := AcroAVDoc_Active.GetPDDoc() AcroPDDoc_Merge := ComObject('AcroExch.PDDoc') AcroPDDoc_Merge.Open(A_Desktop '\CheckIn.pdf') MsgBox AcroPDDoc_Active.GetFileName '`t' AcroPDDoc_Merge.GetFileN...
- 22 Feb 2024, 13:32
- Forum: Ask for Help (v2)
- Topic: Open PDF using ComObject
- Replies: 8
- Views: 365
Re: Open PDF using ComObject
Thanks again, FG. I'm still not sure why the script isn't working on my end. If I add in an "OpenAVDoc" line it'll successfully open the doc trying to be inserted, so everything around it seems to be working. I think the "InsertPages" command might be failing, but I still haven't pinpointed what th...
- 20 Feb 2024, 21:34
- Forum: Ask for Help (v2)
- Topic: Open PDF using ComObject
- Replies: 8
- Views: 365
Re: Open PDF using ComObject
For some reason the second script for merging didn't work. It's not merging and it's also not opening the second document (the Test document). I've tried both the verbose and the condensed versions. Any idea why? You mentioned there is a way to merge without opening the second document. Is this scr...
- 20 Feb 2024, 15:33
- Forum: Scripts and Functions (v2)
- Topic: [Class] GuiReSizer - Position and Resize Gui Controls
- Replies: 28
- Views: 6272
Re: [Class] GuiReSizer - Position and Resize Gui Controls
I added a second ListView it doesn't show guiList.ListView := guiList.Add("ListView", "section +Grid -Multi xm r20 w750", ["This", "That", "Other"]) guiList.ListView.Function := ListView_Columns ; Call Custom Function to Adjust Column Width guiList.ListView.Width := -10 ; 10 from Left Margin guiLis...
- 19 Feb 2024, 18:44
- Forum: Ask for Help (v2)
- Topic: Open PDF using ComObject
- Replies: 8
- Views: 365
Re: Open PDF using ComObject
Here is a script that merges a PDF from a file at the beginning of the active PDF. ; Insert file PDF at the beginning of currently active PDF ; Verbose F12:: { AcroApp := ComObject('AcroExch.App') AcroAVDoc_Active := AcroApp.GetActiveDoc() AcroPDDoc_Active := AcroAVDoc_Active.GetPDDoc() AcroPDDoc_Me...
- 19 Feb 2024, 15:56
- Forum: Ask for Help (v2)
- Topic: Open PDF using ComObject
- Replies: 8
- Views: 365
Re: Open PDF using ComObject
I'm trying to do a seemingly easy action of just opening a specific PDF, but I can't seem to get it to work. Here is code to open a PDF in Acrobat: PDDoc := ComObject('AcroExch.PDDoc') ; create new document object PDDoc.Open(A_Desktop '\Test\Test.pdf') ; open document AVDoc := PDDoc.OpenAVDoc('') ;...
- 15 Feb 2024, 20:43
- Forum: Scripts and Functions (v2)
- Topic: Compose an Outlook Email with an embedded picture
- Replies: 3
- Views: 235
Re: Compose an Outlook Email with an embedded picture
#Requires AutoHotkey v2.0 #SingleInstance Force UniquePictureId := "MyUniquePictureName" PathToPicture := A_ScriptDir "\P01132.jpg" olMailItem := 0 o:= ComObjActive("Outlook.Application").Session() MailItem := ComObjActive("Outlook.Application").CreateItem(olMailItem) MailItem.TO :="recipient@email...
- 06 Feb 2024, 14:42
- Forum: Scripts and Functions (v2)
- Topic: Snipper - Window Snipping Tool
- Replies: 125
- Views: 27986
Re: Snipper - Window Snipping Tool
I just included OCR extention into my Snipper main script but get below error Any of the extension need to be included in a very specific way as described in the post with the extensions. Each of these files can be added to Snipper by including them in the same directory as the Snipper script and t...
- 02 Feb 2024, 14:48
- Forum: Ask for Help (v2)
- Topic: Call function from class instance variable
- Replies: 4
- Views: 301
Re: Call function from class instance variable
Do you have any idea how I can assign a code-block including control structures (if, loops, etc) like in my 2nd post as an anonymous function to a variable? Fat Arrow anonymous functions cannot do loops, but they can do if-statements through a ternary operator. class TestClass { x := (_) => (MsgBox...
- 01 Feb 2024, 19:54
- Forum: Ask for Help (v2)
- Topic: Call function from class instance variable
- Replies: 4
- Views: 301
Re: Call function from class instance variable
How can I call a function stored inside a class instance variable? class TestClass { x := () => MsgBox("x") y := "y" z { get { return this.x } set { this.x := value } } f() { this.x() } } a := () => MsgBox("a") a() test := TestClass() ;OK MsgBox(test.y) ;OK test.x() ;Error: Too many parameters pass...
- 30 Jan 2024, 18:02
- Forum: Ask for Help (v2)
- Topic: working with attachments in outlook
- Replies: 10
- Views: 710
Re: working with attachments in outlook
FanaticGuru's suggestion for how to remove embedded attachments would probably work for deleting the signature images too. However, the code below just looks for files that end in "pdf". If you need to work with image files that cannot be separated from embedded images by their extension, here is a...
- 26 Jan 2024, 21:10
- Forum: Ask for Help (v2)
- Topic: working with attachments in outlook
- Replies: 10
- Views: 710
Re: working with attachments in outlook
The files are saved to disk (I do not think they can be sent without first being saved; someone could prove me wrong on that). One option for copying attachments to a new email without saving the attachments to a file first is to forward the email. olApp := ComObjActive("Outlook.Application") olEma...
- 24 Jan 2024, 17:22
- Forum: Ask for Help (v2)
- Topic: Shortest way to define a 2D Map
- Replies: 8
- Views: 552
Re: Shortest way to define a 2D Map
I use this Prototype code to make working with multidimension maps much easier. ; Helgef: An "n-dimensional" map; ntepa: Map.Prototype Class; FanaticGuru: fat arrow Function ; https://www.autohotkey.com/boards/viewtopic.php?p=520860#p520860 MapN() => (__set := Map.Prototype.GetOwnPropDesc("__Item")....