an 'installer' of sorts

Hey all,

I have a bit of a project i’m looking at doing. It would be used to copy certain files to certain folders on a PSP memory stick.

Of course, anyone with a PSP knows that every memory stick has the same folder format. (Always the same names, in the same order, ect) but the disk name may be different.

Now then, 2 questions

  1. I know how to get the disk name with something like
tell application "Finder"
	set pspstick to (choose disk with prompt "Choose the PSP memory stick")
end tell

but heres the problem. I have a total of approx- 20 or so files, which would go to 5 or so different folders, so it wouldn’t be very efficient to copy them 1 by 1, and try to get the path to each folder on the stick.

Now then, here is where my question is. (Actually, both) Can I just say

Tell application "Finder"
set pspstick to (choose disk with prompt "Choose the PSP memory stick")
end tell
move thisfile to "/pspstick/PSP/GAME/"
move thatfile to "/pspstick/PSP/COMMON/"
move thisfolder to "/pspstick/PSP/SAVEGAME/"
move thatfolder to "/pspstick/PSP/GAME/"

I’m pretty sure that won’t work. But I’d like to do something like that instead of having to find each path ect ect. (Which anyone who knows the file structure knows that would be a pain. Most of these would be installed 3-4 levels deep)

Second… can I create an Application Bundle, and just throw each of the files in there, so that I don’t need to get paths for the files to be moved either?

And if neither of these works, is there at least a somewhat more efficient way of doing this, instead of getting the path to me, then this folder then that folder, ect, which would involve wayyy too many variables?

Any help would be appreciated :smiley:

You could try something like this:

tell application "Finder"
	-- select file you want to copy
	set my_file to the quoted form of (POSIX path of (choose file with prompt "Choose file to copy" without invisibles))
	-- select folder you want to copy file to
	set my_folder to the quoted form of (POSIX path of (choose folder with prompt "Choose folder to copy to" without invisibles))
end tell

-- copy files
do shell script "cp " & my_file & " " & my_folder

That sounds good, but unfortunatly, its why I’m making this.

PC users have an automated installer for this stuff, and i’m attempting to make one for mac. I have an idea as to how to do it, but this whole file path thing has me miffed. Or at least hoping to find a less complex way to do it :stuck_out_tongue:

Where did you see choose disk?

Well, you could create a drag and drop app.

Run the files thru a loop and compare them against a type list for (music, pictures, whatever) and then use if/then statements to copy them to the correct folder.

TRy this to get your disk

set disklist to list disks
set chosendisk to choose from list disklist with title "Disks"

Model: 11 macs, all my babies
AppleScript: 2.1.1
Browser: Safari 417.9.2
Operating System: Mac OS X (10.4)