Re: Creating a folder in user preferences
Re: Creating a folder in user preferences
- Subject: Re: Creating a folder in user preferences
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 23 Feb 2005 19:16:34 -0800
Try
set prefsFolderPath to (path to preferences as Unicode text)
For at least 3 years now you should have been using 'as Unicode text', not
'as string'. It will make a difference for many users. (And 'path to
preferences' is always from user domain - you can include it if you wish,
but you don't need to. It's actually marginally faster to leave 'as Unicode
text' within the the same parentheses as 'path to...' It's an optional
parameter, as an inspection of the Standard Additions will confirm: you
don't need a coercion.)
If that still doesn't work, let us know.
--
Paul Berkowitz
> From: Hanaan Rosenthal <email@hidden>
> Date: Wed, 23 Feb 2005 21:09:22 -0500
> To: <email@hidden>
> Subject: Re: Creating a folder in user preferences
>
> My script goes something like the one below.
> If someone can figure out why on certain user's Macs running OS X it
> won't run, I would be very grateful.
>
> Hanaan
>
> set prefsFolderPath to ((path to preferences from user domain) as
> string)
> set newFolderName to "my folder name"
> set prefsFolderPath_myfolder to prefsFolderPath & newFolderName & ":"
> if not pathExists(prefsFolderPath_myfolder) then
> tell application "Finder"
> try
> make new folder in folder prefsFolderPath with properties
> {name:newFolderName}
> on error err
> display dialog err -- "Could not create folder" buttons {"OK"} with
> icon 0
> quit
> end try
> end tell
> end if
>
>
> on pathExists(thePath)
> try
> alias thePath
> return true
> on error
> return false
> end try
> end pathExists
>
> On Feb 23, 2005, at 8:20 AM, Sander Tekelenburg wrote:
>
>> At 07:07 -0500 UTC, on 2005/02/23, Hanaan Rosenthal wrote:
>>
>>> Does anyone knows under which circumstance trying to create a folder
>>> in
>>> the user's preferences folder by using the "path to preferences folder
>>> from user domain" returns the following error:
>>> "FInder got an error: can't get some object"?
>>> Do some users running OS X not have this folder or not have access to
>>> the 'path to' command?
>>
>> path to belongs to Standard Addistions. Take it out of your Finder tell
>> block. That also removes the need to explcitly coerce to folder: "path
>> to
>> preferences from user domain" is all you need.
>>
>> (If that's not enough: I seem to remember reports problems with paths
>> can
>> occur with users who have Filevault enabled. But I have never tested
>> this
>> myself.)
>>
>>
>> --
>> Sander Tekelenburg, <http://www.euronet.nl/~tekelenb/>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Applescript-users mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>> email@hidden
>>
>> This email sent to email@hidden
>>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Applescript-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden