Inserting POSIX-path of VARIOUS ojects

Hi at all

I just wanted to write a little script. Until I reached one simple difficulty:

The script should be a little GUI for creating password-protected zip-Containers.

This can be done in 10.5 with

zip -e /path/to/file.zip /path/of/object/1 /path/of/object/2 etc.

After that you have to enter a PW and confirm it, which should be easily dealt with in AS.

I’m just puzzled by the task of adding more than one object to the shell-command.

Thanks for any hint

joh

Hi iprecious,

Maybe code as follows could solve your problem. Please note that the sample script currently doesn’t check whether the user drops files or folders.


on open dropitems
	set stringpaths to ""
	set countdropitems to length of dropitems
	repeat with i from 1 to countdropitems
		set dropitem to item i of dropitems
		if i is equal to countdropitems then
			set stringpaths to stringpaths & quoted form of POSIX path of dropitem
		else
			set stringpaths to stringpaths & quoted form of POSIX path of dropitem & space
		end if
	end repeat
	set command to "zip -e /path/to/file.zip " & stringpaths
	log command
end open