AutoHotkey Community

It is currently May 27th, 2012, 3:23 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: June 1st, 2010, 7:57 pm 
Offline

Joined: May 31st, 2008, 3:22 pm
Posts: 47
Image

http://www.autohotkey.com/search/search.php
i try search exact phraze "bad symbols" & "illegal symbols" nothing.

many know exist bad\restricted symbols for windows file & folders same like:
Quote:
\, /, :, *, ", ?, |, <, >


i have problem with regExp

WTF? Save Wintitle containg Restricted symbols to file and delete or (better replace Restricted symbols on Stricted Symbols)


Code:
;#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetTitleMatchMode 2
DetectHiddenWindows On
DetectHiddenText, On
#SingleInstance force

MsgBox F1%A_Tab%Set active title of explorer.exe with bad symbols `nF2%A_Tab%Get & save active win title name to scriptdir (Except BadSymbols) `nF3%A_Tab%Take it back original explorer title

GroupAdd winExp,ahk_class ExploreWClass
GroupAdd winExp,ahk_class CabinetWClass


;SET ACTIVE TITLE WITH BAD SYMBOLS (FOR TEST)
#IfWinActive ahk_group winExp
F1::
badSymbols = \,/, :, *, ?, ", <, >, | RESTRICTED SYMBOLS GETOUT!!!
WinSetTitle, A,, %badSymbols%
Return   


;GET & SAVE ACTIVE WIN TITLE NAME TO SCRIPTDIR (Except BadSymbols)
#IfWinActive ahk_group winExp
F2::
WinGetTitle, AT, A
ControlGetText, path, Edit1, A
;HERE NEED CODE FOR REPLACING RESTRICTED SYMBOLS FROM VARIABLE "AT"
FileAppend, %AT%, %path%\%AT%.txt
Return


;TAKE IT BACK ORIGINAL EXPLORER TITLE
#IfWinActive ahk_group winExp
F3::
ControlGetText, path, Edit1, A
SplitPath, path, nam, dir, ext, nm, drive
WinSetTitle,A,, %nam%
Return

#IfWinActive
Esc::ExitApp


and i try that, same sh1t
Code:
#IfWinActive
F1::
;\/:*?"<>|
;StringReplace Title, outRep, %badsymb%, +, All
;StringReplace, clipboard, clipboard, \/ : * ? " < > |, , All
ta = E:\1prog\*Gr?aph\!Screen Capture\`Console\Capturemation

Loop
{
    StringReplace, fk, ta, /, =,+ UseErrorLevel
    if ErrorLevel = 0  ; No more replacements needed.
    MsgBox %fk% `n%ta%
            Break
           
}

badsymb = \,/, :, *, ?, ", <, >, | NeedAnyLegalSymbolsCozOtherwiseNotSavingToFile
Loop, parse, badsymb, `,
    ;MsgBox %A_LoopField%
    StringReplace, t, ta, %A_LoopField%, =, All
   
MsgBox %ta%
Return

#IfWinActive
Esc::ExitApp




i try use RegExp i have problem


Code:
Line Text: RegExReplace(tit, "\\|\/|\:|\*|\?|\||\<|\>|\"", " ")
Error: Missing ")"


last symbol
Quote:
"
fck brain, help please


that my dream
Image


Last edited by ahkiot0 on June 2nd, 2010, 9:28 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 2nd, 2010, 4:55 am 
Offline

Joined: March 16th, 2008, 6:48 pm
Posts: 161
Location: Brooklyn
Your post is pretty unclear. Basically it seems that you need to use RegEx to do something to edit on a FAT32 filesystem but there are characters which are not allowed... This seems to be the start of it.

I don't think that any of us feel like reading through your code to understand what it is that you are trying to say. So can you just come out and ask a direct and clear question? It would make this much easier for everyone involved.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 2nd, 2010, 8:12 am 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
Vote ++ for sergio. And stop swearing in your posts, it ain't cool 8)

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 2nd, 2010, 9:25 pm 
Offline

Joined: May 31st, 2008, 3:22 pm
Posts: 47
thanks for solving problem skylord5816 from irc://irc.freenode.net/ahk

that solution i try get, dream coming!
Code:
RegExReplace(AT, "[\\/:*?|<>""]", @)



Code:
;GET & SAVE ACTIVE WIN TITLE NAME TO SCRIPTDIR (Except BadSymbols)
#IfWinActive ahk_group winExp
F2::
WinGetTitle, AT, A
ControlGetText, path, Edit1, A
;HERE NEED CODE FOR REPLACING RESTRICTED SYMBOLS FROM VARIABLE "AT"
file = RegExReplace(AT, "[\\/:*?|<>""]", @)
FileAppend, %AT%, %path%\%file%.txt
Return


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], rbrtryn and 17 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group