Sunday, December 17, 2017

#1 2002-02-21 05:41:06 am

Trash Man
Sanitation Department
Registered: 2005-10-20
Posts: 5336

POSIX??

i am trying to correctly use the POSIX path found in the standard additions dictionary. what gets returned looks like this:
:.:Volume/Folder/Folder/File
then i try to pass that to a do shell script, and the script chokes. i think it doesn't understand the :.: in front of the volume name, and niether do i. the do shell script will error and tell me the file does not exist. anyone got this working? here is a simple example of what i'm trying to do:

Applescript:

tell application "Finder"
set x to POSIX path "some path"
do shell script "cd " & x
end tell

i am running 10.1.3.
thanks.


One mans trash is another mans treasure


Filed under: Finder

Offline

 

#2 2002-02-21 11:53:42 am

Trash Man
Sanitation Department
Registered: 2005-10-20
Posts: 5336

Re: POSIX??

unless you want to choose a folder

but this works in X.1.3

Applescript:

set x to POSIX path of "storage:zTest 1" -- storage is a partition of the main drive
set shellScripter to "cd " & "'" & x & "'"
do shell script shellScripter

the reason for the "'" is you need to escape paths with spaces in them for the terminal so what you are passing the terminal is

cd '/Volumes/storage/zTest 1'


One mans trash is another mans treasure

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)