Re: Bug or Spec ?
Re: Bug or Spec ?
- Subject: Re: Bug or Spec ?
- From: Shane Stanley <email@hidden>
- Date: Mon, 13 Nov 2017 22:46:59 +1100
> On 13 Nov 2017, at 6:05 pm, Takaaki Naganoya <email@hidden> wrote:
>
> This code change the name of your selected file and check the existence.
>
> On macOS 10.12.6, this code runs as we expected (true).
> On macOS 10.13.2 beta2, this code returns “false" on the second dialog.
>
>
> (1) This is Finder or alias manager’s bug.
> (2) This is normal behavior of APFS
>
> I can not make a judgement about this.
> I found the System Events can detect the existence of the file after renaming.
I don't *think* it's a Finder bug.
When you run the script under 10.13, for some reason the second exists line
shows the alias path as a POSIX path. So in Script Editor under 10.12 I see
something like this:
choose file
--> alias "Macintosh HD:Users:shane:Desktop:changed77"
end tell
tell application "Finder"
exists alias "Macintosh HD:Users:shane:Desktop:changed77"
--> true
set name of alias "Macintosh HD:Users:shane:Desktop:changed77" to
"changed88"
--> "changed88"
exists alias "Macintosh HD:Users:shane:Desktop:changed88"
--> true
end tell
But under 10.13 I see this:
choose file
--> alias "Macintosh HD:Users:shane:Desktop:changed77"
end tell
tell application "Finder"
exists alias "Macintosh HD:Users:shane:Desktop:changed77"
--> true
set name of alias "Macintosh HD:Users:shane:Desktop:changed77" to
"changed88"
--> "changed88"
exists alias "/Users/shane/Desktop/changed77"
--> false
end tell
My guess is the difference between Finder and System Events boils down to this
(assuming "changed 88"):
tell application "System Events"
alias "/Users/shane/Desktop/changed88"
end tell
This runs and returns an alias, whereas in the Finder:
tell application "System Events"
alias "/Users/shane/Desktop/changed88"
end tell
I get an error. So the Finder result might be unrelated to whether the file
exists, but rather to the way an alias is specified.
But there's something odd happening somewhere…
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
_______________________________________________
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
References: | |
| >Bug or Spec ? (From: Takaaki Naganoya <email@hidden>) |