Re: Help -- going posix space crazy
Re: Help -- going posix space crazy
- Subject: Re: Help -- going posix space crazy
- From: "Chris Espinosa" <email@hidden>
- Date: Fri, 21 Feb 2003 14:37:48 -0800
----- Original Message -----
From: "Marc Glasgow" <email@hidden>
Sent: Friday, February 21, 2003 3:08 AM
Subject: Help -- going posix space crazy
>
The following works as long as the path doesn't have any spaces in the
>
names -- then add spaces, and I get a format error for the mv command.
>
Any insight appreciated. Complete text of the minimized testing script
>
is at:
>
http://www.cyberpoet.net/as/030220help.txt
Have you heard of the 'quoted form' property for strings and Unicode text?
It is very useful for creating things that can be used as parameters in do
shell script or sent to Terminal. It encloses the given string in single
quotes, and escapes any single quotes within the string.
Besides, I think you're using 'POSIX path' when you mean 'POSIX file'.
Given an AppleScript file object (file, alias, etc.) you use the 'POSIX
path' property to get the Unicode text of its path. Given a string that is
supposedly a pathname, you use the 'POSIX file' class with that string to
get an AppleScript file object.
set f to choose file -- f is a file object
set p to POSIX path of f -- p is Unicode text of the path
set f1 to POSIX file p -- f1 is a file object again
set qp to quoted form of p -- qp is a path string you can send to Terminal
even if it contains spaces or special characters
Chris
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.