AutoHotkey Community

It is currently May 27th, 2012, 5:42 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: March 16th, 2010, 2:10 pm 
Offline

Joined: March 16th, 2010, 1:04 pm
Posts: 2
System : XPSP2
AHK 1.0.48.05
Problem : Bug in FileMove & FileCopy

I'm trying to rename a set of file in a directory because their names has a special char not supported by another prog of mines :
L'histoire secrКte - 01 - 00.jpg
L'histoire secrКte - 01 - 01.jpg
L'histoire secrКte - 01 - 02.jpg
... up to 53 suche files

the "К" (not a "K") in the middle of the name induces a strange behaviour to FileMove & FileCopy :

I use the very simple AHK script :
Code:
SetWorkingDir %1% ; drag&drop folder on script
Loop, *.* {
  Filename=%A_LoopFileName%
  Shortname:=SubStr(Filename,RegExMatch(Filename,"[0-9].*")) ; string extraction starts with first numerical char
  IfExist, %Filename%
    MsgBox, Shortname=%Shortname% ; last allright point
;  FileCopy, %Filename%, %Shortname%
  FileMove, %Filename%, %Shortname% ; does nothing
  ErrCount:=ErrLevel
  if (ErrCount>0) ; AND no error reported
    Break
}
MsgBox, ErrCount=%ErrCount%


This should show "Shortname=01 - 00.jpg" in a mesage box and rename the file "L'histoire secrКte - 01 - 00.jpg" to "01 - 00.jpg" and so on.
What I see is :
-mesage box is shown right, so the file name (with "К") is correctly seen by IfExist and the string extraction is OK, but
** FileMove (or FileCopy) does nothing **
** No ErrLevel is reported **

if I change manually the offending char in files to an "e", it works just fine but this is precisely what I try to avoid (manual work I mean).
So, any clue ?

[Moved from Bug Reports forum. ~jaco0646]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 16th, 2010, 5:10 pm 
Offline
User avatar

Joined: May 5th, 2007, 7:24 pm
Posts: 1240
Location: Seville, Spain
К does not belong to your codepage (likely Windows-1252) so it's not supported by vanilla AutoHotkey.
However, AutoHotkey_L (see sig) by Lexikos has a Unicode version.

_________________
fincs
Highly recommended: AutoHotkey_L (see why) (all my code snippets require it)
Formal request to polyethene - I support the unity of the AutoHotkey community
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list]


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Problem Solved
PostPosted: March 16th, 2010, 7:12 pm 
Offline

Joined: March 16th, 2010, 1:04 pm
Posts: 2
Fine advice fincs :D , it just works now !
Thanks a lot for your help !


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo, Google Feedfetcher, HotkeyStick, mrhobbeys, rbrtryn and 62 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