escape spaces in file path for shell script

Hi I have an applescript app bundle with a shell script file embedded. It works as intended until I move the app into a folder that has spaces in the file name. I want to make sure that the app works wherever it’s located. Is there an easy way to escape the spaces in the file path?

set scriptPath to (path to me as text) & "Contents:Resources:Scripts:clean_reports.sed"
set myMessage to (do shell script "sed -n -f " & scriptPath & " " & quoted form of thepath

Hi,

does the -f switch really work with a HFS path?
To escape the spaces use quoted form of like for thepath

set myMessage to (do shell script "sed -n -f " & quoted form of scriptPath & " " & quoted form of thepath

Thanks Stefan. I thought I tried that but I guess the hfs path sunk me. I should have caught that.