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 

Problem passing params to convert doc to txt with >>

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



Joined: 21 Aug 2006
Posts: 19

PostPosted: Sat Jun 07, 2008 3:43 pm    Post subject: Problem passing params to convert doc to txt with >> Reply with quote

Hi Guys,

Part of my script is converting all MS Doc files found in the script directory to Txt files using Antiword: http://www.informatik.uni-frankfurt.de/~markus/antiword/

The command I am using works perfectly from Windows run promt/command prompt (see the msgbox), but not from my script. The output file after the >> is getting lost and the output is just going to screen instead. Sad

I have removed all spaces from the file path I am running this from for simplicity. But ideally it would work with spaces in the path too.

Can you help please? I have been struggling with this for hours!

Thanks!

Kudos

Code:
Loop, %a_scriptdir%\*.doc, 0, 1
{
   StringTrimRight,FileName,A_LoopFileName,4
   MsgBox, C:\antiword\antiword.exe %A_LoopFileFullPath% >> %a_scriptdir%\%FileName%.txt
   RunWait, C:\antiword\antiword.exe %A_LoopFileFullPath% >> %a_scriptdir%\%FileName%.txt
}
Back to top
View user's profile Send private message
garry



Joined: 19 Apr 2005
Posts: 1035
Location: switzerland

PostPosted: Sat Jun 07, 2008 4:45 pm    Post subject: Reply with quote

I've tested this
Code:
SetWorkingDir, %A_scriptdir%
Loop, %a_scriptdir%\*.doc, 0, 1
   {
   StringTrimRight,FileName,A_LoopFileName,4
   run, %comspec% /c c:\antiword\antiword.exe %A_LoopFileShortPath% >>%FileName%.txt,,hide
   }
return


if you want see where the problem is , use
run, %comspec% /k yourprogram.exe .... (without hide)
so see the DOS with error comments
Back to top
View user's profile Send private message
Kudos



Joined: 21 Aug 2006
Posts: 19

PostPosted: Sat Jun 07, 2008 5:33 pm    Post subject: Reply with quote

Thank you garry - perfect Smile

I was wondering what that %comspec% variable was for.. Should have looked it up.

Cheers
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   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