Re: ongoing Senior moments
Re: ongoing Senior moments
- Subject: Re: ongoing Senior moments
- From: Yvan KOENIG <email@hidden>
- Date: Mon, 01 Dec 2014 13:55:29 +0100
Le 01/12/2014 à 12:53, Shane Stanley < email@hidden> a écrit :
On 1 Dec 2014, at 10:38 pm, Yvan KOENIG < email@hidden> wrote: I'm puzzled.
Must I assume that the french system is more fair than the English one ?
No; I was using a path to a folder that didn't exist. But I still don't fancy relying on it longer-term. Especially when there's a simple alternative:
use framework "Foundation" use scripting additions
set theFolder to "~/Pictures/APOD ƒ/" set theFolder to (current application's NSString's stringWithString:theFolder)'s stringByExpandingTildeInPath() as text set theFile to (choose file default location (POSIX file theFolder) as alias)
I was not puzzled by your choice — which is logical — but by the fact that what is working here isn't working for you. Given your answer, we have the same behavior. The instruction
set theFolder to path of disk item theFolder
fails when there is no item whose path is theFolder. But it's no specific to path starting with a tilde.
set theFolder to POSIX path of (path to desktop folder as text) & "n'importe quoi:"
tell application "System Events" set theFolder to path of disk item theFolder end tell
fails too.
Yvan KOENIG (VALLAURIS, France) lundi 1 décembre 2014 13:54:35
|
_______________________________________________
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