Spaces in path

This test code dont work because it has spaces?

set testing to "Macintosh HD:Users:cirno:Desktop:folder with spaces:Test App With Spaces.app" as string
set dp to POSIX path of (testing as Unicode text)
do shell script dp

I think i’m going to use Lingon to launch my script every x minutes, so what i put to ProgramArguments in Lingon to launch x application which has spaces in path? Now it fails because spaces.

Hi cirno,

quoted form is the magic word

set testing to "Macintosh HD:Users:cirno:Desktop:folder with spaces:Test App With Spaces.app" as string
set dp to quoted form of POSIX path of testing 
do shell script dp

btw: for your intense work with AppleScript I recommend reading a book like Haanan Rosenthal’s A Comprehensive Guide ;):wink: