Hi DJ
At first I had to edit a bit your code because the variable aliasFilePaths was not defined.
So I edited the main instruction as :
set brokenAliases to do shell script "/Users/admin/bin/AliasPath -b " & bashList --allAliasFiles
Alas when I tested it I got :
→ error “/Users/???/Library/Speech/Speakable Items/Application Speakable Items/Safari/Target Application Alias: The file “Target Application Alias” couldn’t be opened because there is no such file.
2017-07-26 14:53:54.036 AliasPath[2136:2454891] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘*** -[NSURL initFileURLWithPath:]: nil string parameter’
*** First throw call stack:
(
0 CoreFoundation 0x00007fffa90b157b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fffbe30a1da objc_exception_throw + 48
2 CoreFoundation 0x00007fffa912ec55 +[NSException raise:format:] + 197
3 Foundation 0x00007fffaaa69e8a -[NSURL(NSURL) initFileURLWithPath:] + 131
4 Foundation 0x00007fffaaa69df1 +[NSURL(NSURL) fileURLWithPath:] + 45
5 AliasPath 0x0000000103a287cf main + 863
6 libdyld.dylib 0x00007fffbebeb235 start + 1
7 ??? 0x00000000000001b2 0x0 + 434
)
libc++abi.dylib: terminating with uncaught exception of type NSException” number 1006
I’m really surprised because when I run :
set POSIXPath to "/Users/??????????/Library/Speech/Speakable Items/Application Speakable Items/Safari/Target Application Alias"
set maybe to POSIX file POSIXPath
tell application "System Events"
exists disk item POSIXPath
exists maybe
end tell
tell application "Finder"
exists maybe
end tell
set maybeAlias to (maybe as text) as alias
I get :
CAUTION this is not a script but an history
tell application "System Events"
exists disk item "/Users/??????????/Library/Speech/Speakable Items/Application Speakable Items/Safari/Target Application Alias"
--> false
exists file "SSD 500:Users:??????????:Library:Speech:Speakable Items:Application Speakable Items:Safari:Target Application Alias"
--> true
end tell
tell application "Finder"
exists file "SSD 500:Users:??????????:Library:Speech:Speakable Items:Application Speakable Items:Safari:Target Application Alias"
--> false
Résultat :
error "Le fichier SSD 500:Users:??????????:Library:Speech:Speakable Items:Application Speakable Items:Safari:Target Application Alias est introuvable." number -43 from "SSD 500:Users:??????????:Library:Speech:Speakable Items:Application Speakable Items:Safari:Target Application Alias"
Yes, you read well : the file doesn’t exist when we test its POSIX path but it does when we test the POSIX file.
And there is no such alias.
Given that I’m not too puzzled by the returned error.
I guess that the case “the file doesn’t exist” is not filtered in the CLI.
Yvan KOENIG running Sierra 10.12.6 in French (VALLAURIS, France) mercredi 26 juillet 2017 15:17:06