josephlo Posted October 16, 2011 Share Posted October 16, 2011 Hi, I am new here. Just started to use AutoIT a week ago. I want to write a script that query a DNG raw file and output its IPTC tag. My script currently goes like this: Global $DOS$DOS = Run(@ComSpec & " /c exiftool -T -Headline d:\photo1.dng", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)ProcessWaitClose($DOS)$Message &= StdoutRead($DOS) MsgBox(0, "Exif Data of Photo", $Message) This works well. But how do i make the script recognized the commandline parameter call d:\photo1.dng? So ideally my script will be compiled to an executable say "exif.exe". I want to run in command line window as "exif.exe d:\photo1.dng". How do i make the script recognized that d:\photo1.dng is the parameter? I have tried to integrate the variable $cmdline[1] into the equation but it is not working. Appreciate some help please. Thank youJoseph Link to comment Share on other sites More sharing options...
somdcomputerguy Posted October 16, 2011 Share Posted October 16, 2011 Welcome to the Forum. This may help you - Command Line Parameters. So, $DOS = Run(@ComSpec & " /c exiftool -T -Headline d:\photo1.dng", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD), would probably be $DOS = Run(@ComSpec & " /c exiftool -T -Headline " & $CmdLine[1], @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Good luck! - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
josephlo Posted October 16, 2011 Author Share Posted October 16, 2011 Thanks Bruce. That solves it good. I now need to introduce a -CSV parameter to the exiftool command and the output is something like this: SourceFile,FileName,Headline,Description,Copyright photo1.dng,photo1.dng,This is the Headline,This is the Description,John Doe I am wondering if there is a way for stdout to skip the first output line and only read the 2nd line? If that is doable, i will be able to use the StringSplit command to split the second lines into variables. Thanks again. Joseph Link to comment Share on other sites More sharing options...
somdcomputerguy Posted October 16, 2011 Share Posted October 16, 2011 Take a look at this function, FileReadLine. This'll do it for you I think. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now