On 4/17/06, Peter Bailey <pbailey / bna.com> wrote:> Austin Ziegler wrote:> > On 4/17/06, Peter Bailey <pbailey / bna.com> wrote:> >> I have an application that converts PDFs to individual EPS files. When> >> it does so, it creates a subdirectory with the same name as the original> >> filename and puts all of the resulting EPS files it creates into that> >> directory. Well, I have to do a lot of scripting and stuff on those EPS> >> files. To automate this, I need to know what the directory name is that> >> it put the files. The application provides a variable, "%2," just for> >> this purpose. I've gotten this %2 variable to work for me in cmd.exe.> >> But, I'd like it to work in RUBY. I'm sure it can be done. But, came> >> someone tell me how I can transfer this %2 variable from my application> >> to a Dir.chdir target?> >> > %2 is the 2nd argument on the command-line, so you just have to look> > for ARGV[2].> >> > It'd be interesting to find out what %1 is ;)> Thanks, Austin. So, do I do this?>>  Dir.chdir(ARGV[2])>  or this>  Dir.chdir("ARGV[2]")?
Never the latter.
I'm presuming that what you actually have is a command-line entry boxin your Windows program:
   [ post_process_script %2 ]
If that's how you're configuring it, then your Ruby code must belooking for ARGV[1], not ARGV[2].
-austin--Austin Ziegler * halostatue / gmail.com               * Alternate: austin / halostatue.ca