AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

FileMove & FileCopy Problem

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Sailoratbay



Joined: 16 Mar 2010
Posts: 2

PostPosted: Tue Mar 16, 2010 1:10 pm    Post subject: FileMove & FileCopy Problem Reply with quote

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]
Back to top
View user's profile Send private message
fincs



Joined: 05 May 2007
Posts: 1160
Location: Seville, Spain

PostPosted: Tue Mar 16, 2010 4:10 pm    Post subject: Reply with quote

К 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
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list]
Back to top
View user's profile Send private message
Sailoratbay



Joined: 16 Mar 2010
Posts: 2

PostPosted: Tue Mar 16, 2010 6:12 pm    Post subject: Problem Solved Reply with quote

Fine advice fincs Very Happy , it just works now !
Thanks a lot for your help !
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group