Problems setting up an alias

I am trying to have a script allow the user to select a folder, then copy all the files from that folder to a processing folder, do some stuff to them, then take the processing folder and copy it (plus the contents, 'natch) back into the folder containing the User selected folder (i.e. HD:Folder1:Folder2: , user selects Folder2 and final copy moves processing folder into Folder1) I’ve got everything working, but setting up the alias for the final copy… Here is the code that is giving me the problems

tell application "Finder"
	activate
	set MobiFolder to alias "QUARK:_OEB.Project:FileProcessing:Mobi:"
	set OEBFolder to choose folder with prompt "Select the folder your OEB is in"
	set RetPath to OEBFolder
	set RetPath to RetPath as string
	set RetPath to characters 1 through -5 of RetPath
	set newpath to RetPath as alias

When it tries to set newpath, I get an error. The event log shows

tell application "Finder"
	activate
	choose folder with prompt "Select the folder your OEB is in"
		--> Can't make {"Q", "U", "A", "R", "K", ":", "2", "1", "7", "_", "r", "h", "o", "e", "b", "0", "4", ":", "2", "2", "4", "0", "0", ":", "2", "2", "4", "0", "0", "_", "p", "r", "e", "p", "r", "e", "s", "s", ":", "0", "-", "5", "5", "3", "-", "8", "9", "9", "6", "0", "-", "0", "#", "0", "1", ":", "e", "B", "o", "o", "k", ":"} into a alias.

The filepath in these cases will always end in “OEB:”

Any help will be very appreciated. :slight_smile:

That line should be:

set RetPath to RetPath's text from (character 1) through (character -5) 

I hope. I’m typing this from a Windows machine, so I can’t test.

That worked perfectly. Thanks a bunch :slight_smile: