Help with AppleScript

Discussion in 'Mac Programming' started by rupam.db, Jun 6, 2012.

  1. rupam.db, Jun 6, 2012
    Last edited: Jun 6, 2012

    rupam.db macrumors member

    May 29, 2012
    I'm trying to write an :apple:script for using AtomicParsley

    set [B]atomicparsley_path[/B] to POSIX path of (path to resource "AtomicParsley")
    set [B]file_path[/B] 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 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 :(
  2. kryten2 macrumors 6502a

    Mar 17, 2012
    set file_path to quoted form of POSIX path of (choose file)

Share This Page