Re: ongoing Senior moments
Re: ongoing Senior moments
- Subject: Re: ongoing Senior moments
- From: Shane Stanley <email@hidden>
- Date: Mon, 10 Nov 2014 10:11:36 +1100
On 10 Nov 2014, at 8:06 am, Christopher Stone <email@hidden> wrote:
The Finder itself doesn't like the Posix Path to Posix File coercion even though it will accept the Posix File class.
It's a bit more curious than that, though. You said:
# set theFileX to (POSIX file (expandTildePath(theFolderPath) of me)) # The Finder doesn't like it!
In fact, put that inside another app's tell block, like BBEdit or Mail or whatever, and you'll see it's not liked by any app. But if you change it so the path is hard-coded, rather than the result of a handler, like this:
set theFileX to (POSIX file "/Users/shane/Pictures/APOD ƒ/") # The Finder is appeased
Suddenly the Finder et al are happy with it. So it's not the coercion per se that upsets things.
It's so easy to get tripped up by using different path types or file types that I think it's a good practice to always stick with aliases UNLESS you have a good reason to use something else
Excellent advice, IMO. Note that choose file is happy to accept:
alias posix file posix path
as the target of the default location.
It is now. But then some apps were happy to do the same until recently, and now people have broken scripts. The dictionary specifies aliases, and I think it comes back to your point about good practice above.
|
_______________________________________________
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