Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Shorter script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Shorter script
Authored by: Darkshadow on Jun 04, '03 11:06:07AM
Here, the same script done a little easier. With the save to place defaulting to the user's desktop for free. :)

on open theItems
	set userDesktop to the path to desktop from user domain as text
	tell application "Finder"
		repeat
			display dialog "Enter output file name" default answer userDesktop & "untitled.pdf"
			set rawdata to text returned of the result
			exists file rawdata
			if result = true then
				display dialog "File already exists. Enter different file name."
			else
				exit repeat
			end if
		end repeat
	end tell
	set RawScript to "joinPDF" & space & (the POSIX path of rawdata)
	repeat with aFile in theItems
		set RawScript to RawScript & space & (the POSIX path of aFile)
	end repeat
	do shell script RawScript
end open


This should take a little less time to operate (of course, depends on how fast or slow joinPDF runs). Also, it won't start up Terminal to do the shell script. ;)

[ Reply to This | # ]
Shorter script
Authored by: Darkshadow on Jun 04, '03 11:14:52AM
Oops, little goof, I forgot to add the apostrophes. Change the two lines above to:

set RawScript to "joinPDF" & "\"" & (the POSIX path of rawdata) & "\""
....
set RawScript to RawScript & "\"" & (the POSIX path of aFile) & "\""


...sorry 'bout that one!
(okay, okay, so I didn't use apostrophes, I used quotes...does the same thing :D )

[ Reply to This | # ]
Shorter script
Authored by: Darkshadow on Jun 04, '03 11:24:02AM
Grrr...forgot about the slash thing...you need to do those quotes as:

"'"

(okay, so this time I used apostrophes :p )

[ Reply to This | # ]