Re: Help -- going posix space crazy
Re: Help -- going posix space crazy
- Subject: Re: Help -- going posix space crazy
- From: "Marc S.A. Glasgow" <email@hidden>
- Date: Sun, 23 Feb 2003 02:36:27 -0500
Chris Wrote:
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
And JJ wrote:
By the way, do you know how can I do to make this work?
set f_ to quoted form of posix path of alias "path:to:folder:"
set f2_ to quoted form of "re ksqolis" -- * see note below
paragraphs of (do shell script "cd " & f_ & ";ls " & f2_ & "*")
* f2_ is "re k" + oacute + ntilde + "olis"
And the problem I am currently having with the whole thing is somewhere
in between.
I can built a correct posix path to a specific existing file (simple
enough using POSIX path of file), but I am
having real difficulties building a path to a file that doesn't exist
yet (because it will be invoked into
existence by the "mv filepathA filepathB", as filepathB). Basically,
I'm sucking the path off the existing
file (/Volumes/OS X Spare HD/ClipArt Library/Corp
Catalog/Logos/CC1123.jpg =>
[ref as OurPathName:] /Volumes/OS X Spare HD/ClipArt Library/Corp
Catalog/Logos/ )
and then trying to add to that path a new filename derived from the
folder/directory name
and the current file count ([NewFileName:]Logos 0001.jpg). When
I slap the two parts together (set filepathB to OurPathName &
NewFileName)...
and then, every variation I have tried of this (or on the result of
this concatenation) has resulting in either:
(A) colons being retained, or
(B) spaces not being \ delimited, or
(C) all \ being \ delimited themselves (where space becomes \\[space])
(D) an error in casting the path to a posix file/posix path (because
the file doesn't exist),
(E) keeping it in retained quoted form.
It's enough that I keep working an hour or two on it, then drop it and
go off to do other things,
only to return the next night and repeat the same process with new
methods (and I still haven't
gotten it right!). Arggg!
HELP?!?!?
=-= Marc Glasgow
PS - what happens if I send a file with a resource fork to mv filepathA
filepathB? Not why I should or
shouldn't, but what actually happens (just loss of the resource fork,
or also corruption of the filing system?)?
_______________________________________________
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.