PDA

View Full Version : Help with AppleScript




rupam.db
Jun 6, 2012, 04:11 AM
I'm trying to write an :apple:script for using AtomicParsley

set atomicparsley_path to POSIX path of (path to resource "AtomicParsley")
set file_path to POSIX path of (choose file)
.
.
.
.


If I choose a file such as 01 Apple.txt, file_path takes "/Users/home_folder/Some Folder/sub folder/01 Apple.txt".

How to escape the spaces in file path?
AtomicParsley doesn't takes the file path if it is quoted...it works only when the spaces are escaped
Or is it possible to create a function that replace the " " (space) with "\ " (backslashed space) ? so that file_path gets this string "/Users/home_folder/Some\ Folder/sub\ folder/01\ Apple.txt"

Please help :(



kryten2
Jun 6, 2012, 08:13 AM
set file_path to quoted form of POSIX path of (choose file)