Re: Scripting Filepaths
Re: Scripting Filepaths
- Subject: Re: Scripting Filepaths
- From: "J. Stewart" <email@hidden>
- Date: Thu, 30 Jul 2009 16:23:24 -0400
On 7/30/09 at 11:48 AM, James Bensley <email@hidden>
spake thusly:
set current_user to do shell script("whoami")
set file_path to "/Users/" & current_user & /Desktop/MyFile.abc"
OTH
set file_path to quoted form of posix path of ((path to "desk"
as text) & "MyFile.abc")
Doesn't launch a shell, accomplishes the same thing in one line
and is more reliable because the resulting path is properly
escaped regarding spaces and other special (shell) characters.
John
--
Naturally, the common people don't want war, but after all, it
is the leaders of a country who determine the policy, and it is
always a simple matter to drag people along whether it is a
democracy, or a fascist dictatorship, or a parliament, or a
communist dictatorship. Voice or no voice, the people can always
be brought to the bidding of the leaders. This is easy. All you
have to do is tell them they are being attacked, and denounce
the pacifists for lack of patriotism and exposing the country to
danger. It works the same in every country. -Hermann Goering
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden