coding a variable into a file path

Hi all, I’m new to Applescript and was wondering if anyone could offer suggestions for adding a variable’s result into a file path.

I’m writing a script to download a file, uncompress it, then move three resulting folders to a new directory. Since not everyone has the same name for their hard drive, I’m trying to do this:

set file_path to path to root
tell application “URL Access Scripting”

download the web_URL to "root:compressed_file_name" replacing yes with progress     and unpacking
quit

end tell

That doesn’t work…
Also, URL Access scripting broke after a crash and now tries to reference the OS 9 version of the addition. Any suggestions?

Finally, the file is a .sit, but unpacking has no effect? Do I need to invoke Stuffit?

Many thanks for your replies.

Jesse Bastide

Exactly what do you mean by ‘root’? The current user’s root folder? Does this snippet provide the correct result?

set userFol to path to current user folder

What if I want to determine the name of what should be the users “Macintosh HD”? How would I determine that?

This might work:

set userFol to path to current user folder

set oldDelims to AppleScript's text item delimiters
try
	set AppleScript's text item delimiters to {":"}
	set hdName to first text item of (userFol as text)
	set AppleScript's text item delimiters to oldDelims
on error
	set AppleScript's text item delimiters to oldDelims
end try

display dialog hdName

tell application "Finder"
	set myVar to the name of startup disk
end tell

Hey, that’s too easy and portable! :stuck_out_tongue: