View Single Post
Mark FX

 
Mark FX's Avatar
 
Member Since: Aug 13, 2011
Location: West Sussex, UK
Posts: 167
Mark FX has a spectacular aura about

Mark FX is offline
Well done for getting it working, dont forget the "end try" statement in your code snippet is missing it.
Also consider using an error trap in your try statements, this will help you debug your code much easier, when things go wrong, also you can use the error trap to display a dialog bog to the user, with a useful desciption of the fault.

Like this.

Code:
try
        -- Some code that might cause an error
on error error_message number error_number
	return "Error" & space & error_message & space & error_number as text
end try
And yes your correct, shell scripts only understand POSIX paths, where Applescript commands usually return a HFS colon delimited path, unless otherwise you convert it,
also you need to escape the POSIX path string, in case it contains spaces or other unsupported characters.

Good luck with it.

Regards Mark
QUOTE Thanks