Search found 159 matches

by colt
11 Sep 2020, 10:43
Forum: Ask For Help
Topic: wingetpos with respect to virtual dimensions Topic is solved
Replies: 4
Views: 88

Re: wingetpos with respect to virtual dimensions Topic is solved

Thanks DyaTactic for putting that together. It works really well. In the meantime I came up with an alternative solution, although it is much more complex. I got started down this track and couldn't stop until I got it to work. It is probably not useful for many people but maybe there are some nugge...
by colt
10 Sep 2020, 12:43
Forum: Ask For Help
Topic: Script to detect if text was selected from left to right or from right to left?
Replies: 1
Views: 84

Re: Script to detect if text was selected from left to right or from right to left?

try this

Code: Select all

~Lbutton::
	mouseGetPos,x1
return

~Lbutton UP::
	mouseGetPos,x2
	dx := x2-x1	
	if(dx>10)
	{	
		tooltip left to right
	}
	else if(dx<-10)
	{
		tooltip right to left
	}
	else
	{
		tooltip normal click
	}
return
by colt
04 Sep 2020, 08:57
Forum: Ask For Help
Topic: Using a script to run a function in another script Topic is solved
Replies: 13
Views: 316

Re: Using a script to run a function in another script Topic is solved

You could use sendMessage. I use this to communicate between temporary programs and a main script that runs all day. mainScript.ahk ;main script that keeps control of database and is running most of day #persistent #singleinstance force OnMessage(0x4002, "testFunction") ;create listener for messages...
by colt
02 Sep 2020, 09:34
Forum: Ask For Help
Topic: How to improve reescaled photos on a gui?
Replies: 5
Views: 64

Re: How to improve reescaled photos on a gui?

This would really slow it down depending on the power of your computer, but you could resize the image with imagemagick to a temp file before displaying the temp file in gui.
by colt
02 Sep 2020, 09:10
Forum: Ask For Help
Topic: wingetpos with respect to virtual dimensions Topic is solved
Replies: 4
Views: 88

Re: wingetpos with respect to virtual dimensions Topic is solved

I thought this solved it, but after more thorough testing it appears to give the same result as the original script. If you position your monitors with the primary display to the right of your secondary display then the origin will be directly between the two screens. My goal is to move it to the up...
by colt
01 Sep 2020, 09:31
Forum: Ask For Help
Topic: wingetpos with respect to virtual dimensions Topic is solved
Replies: 4
Views: 88

wingetpos with respect to virtual dimensions Topic is solved

When I change my default monitor I get different values for winGetPos. The x origin is always 0 on left side of main display. How can I map winGetPos result to virtual dimensions without setting manual offsets? SysGet, VirtualWidth, 78 SysGet, VirtualHeight, 79 loop { winGetPos,x,y,,,A tooltip % Vir...
by colt
26 Aug 2020, 18:29
Forum: Ask For Help
Topic: Intercepting print job to detect full file path
Replies: 0
Views: 87

Intercepting print job to detect full file path

I am attempting to intercept certain files before they print to overlay a bar code containing the md5 hash of the source file. I tried looking at the Win32_PrintJob which will show the filename of the document but not full path. ;pause printer before printing to load file onto queue before running t...
by colt
26 Aug 2020, 17:31
Forum: Ask For Help
Topic: Monitor Info using ComObjGet
Replies: 1
Views: 153

Re: Monitor Info using ComObjGet

Threre are several ways to do this. The most basic is to use a simple array to store each instance of the monitor. wmi := ComObjGet("winmgmts:{impersonationLevel=impersonate}!\\" A_ComputerName "\root\wmi") monitors := [] for monitor in wmi.ExecQuery("Select * from WmiMonitorID") ;extract names { fn...
by colt
26 Aug 2020, 11:43
Forum: Ask For Help
Topic: Volume Slider Progress Bar Question
Replies: 5
Views: 122

Re: Volume Slider Progress Bar Question

Add

Code: Select all

global id := 1
to the auto-execute section of your code to initialize the control name. Otherwise id doesn't get set until you click on the control with WM_LBUTTONDOWN.
Cool script though. Now I have to find a place to use this technique.
by colt
14 Aug 2020, 21:06
Forum: Ask For Help
Topic: Get variable pointer inside class. Topic is solved
Replies: 1
Views: 1529

Get variable pointer inside class. Topic is solved

How can I get the pointer to a variable inside a class like in the code below? What is the proper syntax? classItem := new test() msgbox % &classItem ;works class test { __new() { this.classVar := "test" msgbox % &this.classVar ;empty msgbox % &(this.classVar) ;empty } } My ultimate goal is to use v...
by colt
12 Aug 2020, 09:00
Forum: Ask For Help
Topic: "if process exist" question...
Replies: 3
Views: 1467

Re: "if process exist" question...

The code takes a long time to execute on my computer, about 5 seconds for all running processes. I think it is the getowner function really slows things down. What I would do would be to create a special query to pass to ExecQuery where you filter out only your specific program you care about: 'abc....
by colt
03 Aug 2020, 18:44
Forum: Ask For Help
Topic: Making LCtrl logicically up while it’s physically down? Topic is solved
Replies: 2
Views: 1270

Re: Making LCtrl logicically up while it’s physically down? Topic is solved

Try this ^WheelUp:: MouseGetPos, xpos, ypos state1 := Getkeystate("LCtrl","P") Hotkey, LControl , disableCtrl, On ;temp hotkey creation for just the ctl button to consume key press state2 := Getkeystate("LCtrl","P") ;do your stuff here Hotkey, LControl , disableCtrl, off ;turn control back to normal...
by colt
03 Aug 2020, 16:41
Forum: Ask For Help
Topic: "if process exist" question...
Replies: 3
Views: 1467

Re: "if process exist" question...

From here https://autohotkey.com/board/topic/72817-how-to-obtain-%E2%80%9Cuser-name%E2%80%9D-from-running-processes/ Use GetOwner to find out which user launched the process. Gui, Add, ListView, x2 y0 w400 h500, Process Name|Command Line|User Name for proc in ComObjGet("winmgmts:").ExecQuery("Select...
by colt
31 Jul 2020, 11:14
Forum: Ask For Help
Topic: Detecting ramdisk
Replies: 3
Views: 989

Re: Detecting ramdisk

if you know it acts that way, but is working fine, erm, so what?? That is true for my primary computer. I can just hard code it into the program. The problem is I use this script on numerous computers that may have the Y: slot already taken. I was hoping for a simple robust way to detect and attach...
by colt
31 Jul 2020, 10:24
Forum: Ask For Help
Topic: Detecting ramdisk
Replies: 3
Views: 989

Detecting ramdisk

I am tinkering with ramdisks and I am trying to detect if one is available for use with a disk intensive operation. I am having trouble detecting the drive type though. I set up the ramdisk with the AMD Radeon RAMDisk Configuration Utility which creates the Y: drive. The drive shows up in explorer l...
by colt
29 Jul 2020, 12:32
Forum: Ask For Help
Topic: Need Help Getting Values from XML Text Topic is solved
Replies: 12
Views: 2675

Re: Need Help Getting Values from XML Text Topic is solved

@TheDewd gotcha, seemed too good to be true haha
by colt
29 Jul 2020, 10:52
Forum: Ask For Help
Topic: Need Help Getting Values from XML Text Topic is solved
Replies: 12
Views: 2675

Re: Need Help Getting Values from XML Text Topic is solved

This is janky but gets the job done.

Code: Select all

fileRead xml,xmlSource.xml

boldArr := strSplit(xml,["[b]","[/b]"])
bolds := 
for index,entry in boldArr
{
	if(!mod(index,2))
	{
		bolds .= entry . "`n"
	}
}

clipboard := bolds
by colt
29 Jul 2020, 09:13
Forum: Ask For Help
Topic: Ditto- How to Paste Plain Texts Topic is solved
Replies: 2
Views: 1125

Re: Ditto- How to Paste Plain Texts Topic is solved

Try this. It works for me in word. ;as example copy some text with formatting to clipboard before launching script ;you would need to store these values in your clipboard memory array each time you ^C ;this works in word textWithFormatting := clipboardAll textRaw := clipboard ^Numpad1:: ;retain form...
by colt
27 Jul 2020, 18:38
Forum: Ask For Help
Topic: Piping variable into ghostscript Topic is solved
Replies: 1
Views: 1224

Re: Piping variable into ghostscript Topic is solved

Found out that you need to pipe the contents of the postscript in before calling the ghost script command. This applies the overlay without a temp file. SplitPath, A_ScriptDir , OutFileName, OutDir, OutExtension, OutNameNoExt, OutDrive cmd := OutDrive . "&" cmd .= "cd " . A_ScriptDir . "&" ;the "-_"...
by colt
27 Jul 2020, 11:43
Forum: Ask For Help
Topic: Copy PDF to Website form
Replies: 1
Views: 723

Re: Copy PDF to Website form

Does this work for you? CoordMode, Mouse, Screen SetTimer, Check, 20 ttText := "" return Check: MouseGetPos, xx, yy ttText := "Pos : " . xx . "," . yy . "`n" . target Tooltip % ttText return F7:: ; set target location MouseGetPos, targetX, targetY target := "Target : " . targetX . "," . targetY retu...

Go to advanced search