Search found 110 matches

by ahcahc
01 Mar 2016, 10:42
Forum: Ask For Help
Topic: RegEx Help Line Should End with Period, if no period at the end of line.
Replies: 11
Views: 2102

Re: RegEx Help Line Should End with Period, if no period at the end of line.

Code: Select all

string := "
(
Say no to 1 hour meetings
Do the Steve Jobs walk.
Visualize your success      
alot of space(s) after this                       
a number 123


there are blank lines above and below



some text

)"
MsgBox % RegExReplace(string,"`am)[ \t]+$|(?<=\w)$",".")
by ahcahc
19 Oct 2014, 21:57
Forum: Ask For Help
Topic: URLToVar function ERROR_INTERNET_TIMEOUT
Replies: 7
Views: 3395

Re: URLToVar function ERROR_INTERNET_TIMEOUT

You can suppress comobjct errors with ComObjError(false) . This way your script can keep on running. This is what I use. Found it somewhere and added ComObjError(false) . UrlDownloadToVar(URL) { ComObjError(false) WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1") WebRequest.Open("GET", URL) W...
by ahcahc
13 Oct 2014, 08:27
Forum: Ask For Help
Topic: SOLVED: Latest 10 lines of a variable
Replies: 6
Views: 1526

Re: Latest 10 lines of a variable

MsgBox % last10 := RegExReplace(RESULTAT,"`as).*?((?:(?:\V+)?\R){9}\V+$)","$1")
Your last line will always be blank. You can use trim to remove the last linefeed RegExReplace(trim(RESULTAT,"`n"),"`as).*?((?:(?:\V+)?\R){9}\V+$)","$1")
or
RESULTAT .= (RESULTAT?"`n":"") FIND6
by ahcahc
12 Oct 2014, 10:51
Forum: Ask For Help
Topic: Script to automatically join highlighted text with hyphens?
Replies: 4
Views: 1369

Re: Script to automatically join highlighted text with hyphe

Code: Select all

F1::
old_clipboard := ClipboardAll
Clipboard=
SendInput, ^c
ClipWait, 1
Clipboard := RegExReplace(clipboard,"(?<=\S) (?=\S)","-")
SendInput, ^v
Sleep, 1
Clipboard := old_clipboard
return
by ahcahc
10 Oct 2014, 21:46
Forum: Ask For Help
Topic: RegexReplace intermittently fails in my script.
Replies: 6
Views: 2050

Re: RegexReplace intermittently fails in my script.

try text_list := RegExReplace(text_list, chr(12))
by ahcahc
10 Oct 2014, 00:06
Forum: Ask For Help
Topic: RegExMatch Multiline get line number it was found on
Replies: 7
Views: 2587

Re: RegExMatch Multiline get line number it was found on

I've learned something new. var = ( The Egyptian pyramids are ancient pyramid-shaped There are 138 pyramids discovered in Egypt as of 2008.[1][2] The earliest known Egyptian pyramids are found at Saqqara, The most famous Egyptian pyramids are those found at Giza By the time of the early dynastic per...
by ahcahc
09 Oct 2014, 00:31
Forum: Ask For Help
Topic: remove blank lines
Replies: 17
Views: 4763

Re: remove blank lines

var := RegExReplace(var,"`am)^\s+|\s+?(?=\R$)")
var := RegExReplace(RegExReplace(var,"`am)^\s+"),"\s*$")
by ahcahc
07 Oct 2014, 23:00
Forum: Ask For Help
Topic: remove blank lines
Replies: 17
Views: 4763

Re: remove blank lines

var := RegExReplace(var,"`am)^\s+")
by ahcahc
22 Sep 2014, 11:52
Forum: Ask For Help
Topic: removing duplicates from two separate strings
Replies: 8
Views: 2075

Re: removing duplicates from two separate strings

listingA := "cat|dog|fish|rabbit" listingB := "bee|cat|dog|gorilla" listingC := "apple|cat|mango|gorilla|tank" listingD := "apple|candle|maple" listingE := "pet|dog" MsgBox % strComp("|",listingA,listingB,listingC,listingD,listingE) strComp(s,a,b*) ;s=separator a=stringa b=stringb or stringb,string...
by ahcahc
20 Sep 2014, 10:04
Forum: Ask For Help
Topic: Concatenate strings and pass it to function in same loop
Replies: 5
Views: 3042

Re: Concatenate strings and pass it to function in same loop

Why not msgbox after the loop was completed?
by ahcahc
18 Sep 2014, 09:51
Forum: Ask For Help
Topic: Unix/Epoch Timestamp to Readable Format, UTC/GMT Time?
Replies: 2
Views: 2141

Re: Unix/Epoch Timestamp to Readable Format, UTC/GMT Time?

Code: Select all

now := A_NowUTC
EnvSub, now,1970, seconds
MsgBox % "epoch now: " now

epoch=1411048064
current := 1970
current += epoch, Seconds
FormatTime, timenow, %current%, yyyy-MMM-dd HH:mm:ss
MsgBox % "epoch: " epoch "`n" timenow
by ahcahc
18 Sep 2014, 06:15
Forum: Ask For Help
Topic: Catching spaces with Regex (simple)
Replies: 5
Views: 1752

Re: Catching spaces with Regex (simple)

because ( ) has 3 spaces in them. try using FoundPos := RegExMatch(A_LoopField, "^(\s+)\*", SubPat)
by ahcahc
15 Sep 2014, 23:08
Forum: Ask For Help
Topic: Replace/change text in PDF files Topic is solved
Replies: 2
Views: 1437

Re: Replace/change text in PDF files Topic is solved

It it possible to automate the conversion of pdf to text (you need another programs to convert pdt to text), and then you can modify the converted text, then write it to a text file then convert that text file to pdf.
by ahcahc
12 Sep 2014, 23:16
Forum: Ask For Help
Topic: Is there a RegExMatch option to search right to left?
Replies: 13
Views: 11082

Re: Is there a RegExMatch option to search right to left?

With starting position. h:="a65 b c d ff1ff3fffabcffaffff12ffffafabcabcb12cd664429123443" ;n:="\w\w" ;n:="[a-z]\d" ;n:="65" n:="\d\d\d\d" pos := RevExMatch(h,n,m,"a",allm,59) ;pos := RevExMatch(h,n,m,"a",allm) MsgBox % "last matched position: " pos "`nlast matched: " m "`nall matches: " allm "`nhays...
by ahcahc
12 Sep 2014, 06:46
Forum: Ask For Help
Topic: Version of Autohotkey
Replies: 4
Views: 1487

Re: Version of Autohotkey

/* A_AhkVersion : In versions prior to 1.0.22, this variable is blank. Otherwise, it contains the version of AutoHotkey that is running the script, such as 1.0.22. In the case of a compiled script, the version that was originally used to compile it is reported. The formatting of the version number ...
by ahcahc
12 Sep 2014, 06:20
Forum: Ask For Help
Topic: Is there a RegExMatch option to search right to left?
Replies: 13
Views: 11082

Re: Is there a RegExMatch option to search right to left?

This should work. h:="a65 b c d ff1ff3fffabcffaffff12ffffafabcabcb12cd" n:="\d\d" ;h:="b a b a b" ;n:="b" loop if pos := RegExMatch(a_Index=1?h:SubStr(h,1,pos?pos:strlen(h)),n,m,strlen(h)-A_Index) { if (strlen(h)-A_Index)<0 break if (pos_old!=pos) { pos_old:=pos MsgBox % "Found ``" m "`` at position...
by ahcahc
12 Sep 2014, 03:52
Forum: Ask For Help
Topic: Is there a RegExMatch option to search right to left?
Replies: 13
Views: 11082

Re: Is there a RegExMatch option to search right to left?

Code: Select all

h:="a b c d fffffffffaffffffffafffffd"
n=a
loop, % strlen(h)
if pos := RegExMatch(A_index=1?h:SubStr(h,1,strlen(h)-StrLen(n)*A_Index),n,m,strlen(h)-StrLen(n)*A_Index)
  MsgBox % " found ``" m "`` at position " pos
by ahcahc
11 Sep 2014, 09:39
Forum: Ask For Help
Topic: WinMove Problems in Photoshop CS6
Replies: 12
Views: 3503

Re: WinMove Problems in Photoshop CS6

x=0,y=0 starts at the upper left corner. so if you use negative y it will try to go up, negative x will go left, try using positive value.
by ahcahc
11 Sep 2014, 09:26
Forum: Ask For Help
Topic: Script to close application after opening PC
Replies: 6
Views: 1688

Re: Script to close application after opening PC

#Persistent #SingleInstance Ignore SetTimer, check_skype, 1000 return check_skype: Process, Exist, skype.exe if(errorlevel!=0) { Process, close, skype.exe RunWait, %comspec% /c taskkill /f /im skype.exe, , hide ExitApp } elapse := A_TickCount/1000/60 if (elapse>5) ;pc was already powered-on for at ...

Go to advanced search