AutoHotkey Community

It is currently May 26th, 2012, 3:21 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: March 31st, 2005, 6:38 am 
Offline

Joined: November 3rd, 2004, 8:43 pm
Posts: 34
I am trying to run PDF Toolkit with a a list of files to merge to an output file. The list of files must be on the same line as the run command and each file is separated by a space e.g.

Run pdftk.exe file1.pdf file2.pdf file3.pdf fileetc.pdf output filesmerged.pdf

However, the message box in the code below shows 2 problems:

1) the directory name is shown
2) the file names are on separate lines

How do I correct problems 1) and 2)?

Code:
; Based on MULTI-SELECT EXAMPLE from Help File
FileSelectFile, files, M3, *.pdf  ; M3 = Multiselect existing files.
if files =
{
   MsgBox, The user pressed cancel.
   return
}
Loop, parse, files, `n
{
MsgBox, 0, , %files% `n

Run, F:\Program Files\pdftk-1.12\pdftk.exe, %files% output f:\temp\output.pdf
}
return


Many thanks,
Martin


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 31st, 2005, 7:22 am 
directory/full path: use AHK's SplitPath command
Quote:
SplitPath, lines,, OutDir ; get directory
separate lines: check AHK's StringReplace command to replace the line ending chars with spaces and to remove a path/dir ...
Quote:
StringReplace, files, files, %OutDir%,, All ; remove dir(s) from inputvar
StringReplace, files, files, `n, %A_Space%, All ; replace line endings with spaces to get a single line var


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: 0x150||ISO, coinman, LazyMan, Pulover, Yahoo [Bot] and 19 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