Re: Creating a folder in user preferences
Re: Creating a folder in user preferences
- Subject: Re: Creating a folder in user preferences
- From: Hanaan Rosenthal <email@hidden>
- Date: Wed, 23 Feb 2005 21:09:22 -0500
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
<x-tad-smaller>
</x-tad-smaller>
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:
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