Search found 1230 matches

by FanaticGuru
04 Sep 2018, 13:05
Forum: Ask For Help
Topic: New expression format doesn't seem to work
Replies: 6
Views: 129

Re: New expression format doesn't seem to work

How about #if WinActive("ahk_class Notepad") ? Regards Yea, There is a big difference between: if and #if and between ifWinExist and #ifWinExist FG Sorry I'm confused doesn't the hatch make it a hot key/string. I don't want a hotkey. When you use the # it is then a script directive that effects all...
by FanaticGuru
04 Sep 2018, 12:04
Forum: Ask For Help
Topic: ahk: Excel Lastrow
Replies: 4
Views: 122

Re: ahk: Excel Lastrow

Since you are looping anyways there is no real need to know ahead of time how many rows there are. You can just start looping through the cells with a check to stop when you hit a blank cell. This makes the code somewhat simpler. xlApp := ComObjActive("Excel.Application") For Cell in xlApp.Sheets(1)...
by FanaticGuru
31 Aug 2018, 17:01
Forum: Ask For Help
Topic: How to retrieve values from a table
Replies: 1
Views: 93

Re: How to retrieve values from a table

ValueName001 ValueAge001 ValueHeight001 ValueAge001 ValueName002 ValueAge002 ValueHeight002 ValueAge002 ValueName003 ValueAge003 ValueHeight003 ValueAge003 ValueName004 ValueAge004 ValueHeight004 ValueAge004 ValueName005 ValueAge005 ValueHeight005 ValueAge005 And I need AHK to do the following: a) ...
by FanaticGuru
31 Aug 2018, 16:43
Forum: Ask For Help
Topic: New expression format doesn't seem to work
Replies: 6
Views: 129

Re: New expression format doesn't seem to work

Scr1pter wrote:How about
#if WinActive("ahk_class Notepad")
?

Regards
Yea,

There is a big difference between:
if and #if

and between
ifWinExist and #ifWinExist

FG
by FanaticGuru
24 Aug 2018, 15:11
Forum: Ask For Help
Topic: Trying to get better at arrays, need help
Replies: 3
Views: 121

Re: Trying to get better at arrays, need help

Ok, Figured it out for anyone who is curious for each, element in Data { if (ThisName = element.Name) { PersonA := element.User } } This seems more well suited to an associative array. #SingleInstance Force ; get info into Data array UserNames= ( John Bob Tom ) UserIDs= ( J B T ) Names := StrSplit(...
by FanaticGuru
22 Aug 2018, 13:03
Forum: Ask For Help
Topic: variable for Outlook
Replies: 2
Views: 76

Re: variable for Outlook

I cant put a carriage return in a variable. Here is my code. omolist = test ;this works promolist = test`n123 ;this does not work FormatTime, CurrentDateTime,, MM-dd-yy body = %promolist% subject:=CurrentDateTime " promos are on 1030view Omneon HARMONIC and PM EXPORTS" email:="person1@xxx.org;perso...
by FanaticGuru
22 Aug 2018, 12:46
Forum: Ask For Help
Topic: Gotta be a cleaner way
Replies: 3
Views: 122

Re: Gotta be a cleaner way

Can someone with more experience than myself show me how this could be cleaned up and made simpler? I don't have the interest to go through all the code but you need to use some various loops, maybe some subroutines or functions. Here is an example: ;~ A1:=pwb.document.GetElementsByTagName("TD")[14...
by FanaticGuru
21 Aug 2018, 19:42
Forum: Ask For Help
Topic: COM, Outlook, ClipboardAll
Replies: 8
Views: 206

Re: COM, Outlook, ClipboardAll

Outlook := ComObjActive("Outlook.Application") email := Outlook.CreateItemFromTemplate(A_Desktop "\Untitled.oft") email.To := "someone@email.com" email.Subject := "COM email test with formatting" ; .Display(true) - True to make the window modal. The default value is False. ; The modal window seems ...
by FanaticGuru
21 Aug 2018, 16:02
Forum: Ask For Help
Topic: COM, Outlook, ClipboardAll
Replies: 8
Views: 206

Re: COM, Outlook, ClipboardAll

I'm not sure where to begin on writing some HTML.. so I looked into a normal paste. The one thing is, when I use window spy I can't seem to 'see' the body messsage. The only control name I can find is "_WwG1" and setting text has no effect. I can however use ControlFocus to activate the body. The o...
by FanaticGuru
21 Aug 2018, 15:00
Forum: Ask For Help
Topic: COM, Outlook, ClipboardAll
Replies: 8
Views: 206

Re: COM, Outlook, ClipboardAll

The Help for ClipboardAll explains it pretty well. ClipboardAll returns the binary formatted information of the clipboard and is rarely what you want. Clipboard is what you would normally use in situations like this. FG Thanks for the reply. The only thing is, when I use Clipboard it just behaves a...
by FanaticGuru
21 Aug 2018, 14:38
Forum: Ask For Help
Topic: COM, Outlook, ClipboardAll
Replies: 8
Views: 206

Re: COM, Outlook, ClipboardAll

Hello, In the code below, ClipboardAll does not appear to be working. I'm copying a range of cells from Excel and then wanting that data to be in the message body, with the formatting and cell colors as a manual paste result. Does anyone know how I can accomplish this? Thanks in advance! Outlook :=...
by FanaticGuru
20 Aug 2018, 18:31
Forum: Ask For Help
Topic: Save outlook items with Date and Subject
Replies: 4
Views: 163

Re: Save outlook items with Date and Subject

Thanks, unfortunately this gives me a 00.00 as a time. what could be wrong ? All I can tell you is that the script works for me. When I activate this script: F12:: olApp := ComObjActive("Outlook.Application") try olItem := olApp.ActiveWindow.CurrentItem catch olItem := olApp.ActiveExplorer.Selectio...
by FanaticGuru
20 Aug 2018, 16:59
Forum: Ask For Help
Topic: Excel IP in Cell convert to URL ?
Replies: 9
Views: 193

Re: Excel IP in Cell convert to URL ?

Below is an AHK COM solution: xlApp := ComObjActive("Excel.Application") for Cell in xlApp.ActiveSheet.UsedRange.Cells if RegExMatch(Cell.Value2, "\d*\.\d*\.\d*\.\d*", IP) xlApp.ActiveSheet.Hyperlinks.Add(Cell, IP,,, "http://" IP) This will loop through all the used cells of the active worksheet and...
by FanaticGuru
15 Aug 2018, 17:29
Forum: Ask For Help
Topic: Pulling cell value from excel during a loop
Replies: 1
Views: 87

Re: Pulling cell value from excel during a loop

Purpose: Copy the text from cell AY6 in an open excel sheet into a text box in another active program. The text changes everyday thus the need to reference a cell rather than a static piece of text. Excel Location: "T:/Task Assignments/Order Management/CNF/qsod104 - PFS CNF Overview_180127" Excel N...
by FanaticGuru
13 Aug 2018, 12:42
Forum: Ask For Help
Topic: Small code to run Calc
Replies: 10
Views: 354

Re: Small code

I am ending using v1 EXE conversion of: Insert:: #SingleInstance force if WinExist("Calculator") WinActivate else Run "C:\Program Files\Calc.exe" WinSet, Top return but when Calc is not running, I have to press Insert twice in order to run the EXE converted code twice, to have Calc on top. If I run...
by FanaticGuru
08 Aug 2018, 20:06
Forum: Ask For Help
Topic: Small code to run Calc
Replies: 10
Views: 354

Re: Small code

Hello, I am trying to write a code to open a exe file (Calculator) when press Insert key. The code it's working when using 1.1 for converting to EXE, but not with 2.0. I want: 1. to use 2.0 2. that the Calculator window to be on top after press Insert (maybe using WinMoveTop). Thank you Insert:: #S...
by FanaticGuru
07 Aug 2018, 19:51
Forum: Ask For Help
Topic: How to use script2 to block script1's hotkeys when a specific window is active WITHOUT using IfWinActive
Replies: 7
Views: 181

Re: How to use script2 to block script1's hotkeys when a specific window is active WITHOUT using IfWinActive

first.ahk q::MsgBox % "from first" second.ahk #If WinActive("ahk_exe notepad.exe") q::return #If try if it works for your app This is the solution I would recommend also. When two scripts have the same hotkey the last one run has priority. In this case the second script is checked first. If notepad...
by FanaticGuru
01 Aug 2018, 14:33
Forum: Ask For Help
Topic: Start Script When Game Starts?
Replies: 10
Views: 233

Re: Start Script When Game Starts?

Yea... when my game window is active and I hit ctrl+f1 nothing pops up. It does pop up boxes for other active windows, but for some reason not for the game window. Some programs block virtual key presses either by convenience or on purpose. Adding #UseHook or #InstallKeybdHook at the top of script ...
by FanaticGuru
31 Jul 2018, 12:16
Forum: Ask For Help
Topic: Too fast
Replies: 2
Views: 159

Re: Too fast

Also, if you use Sleep you need to make sure it is inside the while-loop.

Code: Select all

XButton1::
While GetKeyState("XButton1","P")
{
   Send, e
   Sleep 500
}
return
FG
by FanaticGuru
30 Jul 2018, 17:13
Forum: Ask For Help
Topic: Excel paste into next column
Replies: 6
Views: 216

Re: Excel paste into next column

next empty column on row 1 while xl.Cells(1, A_Index).value { col := A_Index+1 continue } xl.Cells(1, col) := num The Find method is normally quicker and easier than looping through all the cells. xlApp := ComObjActive("Excel.Application") MsgBox % Empty_Column := xlApp.Rows(1).Find("*",,,,,2).Colu...

Go to advanced search