Re: ongoing Senior moments
Re: ongoing Senior moments
- Subject: Re: ongoing Senior moments
- From: Yvan KOENIG <email@hidden>
- Date: Mon, 10 Nov 2014 15:09:05 +0100
> Le 10/11/2014 à 14:59, Robert Poland <email@hidden> a écrit :
>
>
>> On Nov 10, 2014, at 6:35:AM, Luther Fuller <email@hidden> wrote:
>>
>> On Nov 9, 2014, at 7:02 PM, Robert Poland wrote:
>>
>>>
>>>> On Nov 9, 2014, at 5:56:PM, Christopher Stone <email@hidden> wrote:
>>>>
>>>> On Nov 09, 2014, at 18:29, Robert Poland <email@hidden> wrote:
>>>>> …
>>>>> set startLoc to (folder "APOD ƒ" of folder "Pictures" of startup disk) as alias
>>>>>
>>>>> Won’t compile in Yosemite.
>>>>
>>
>> The alternates I gave ARE Finder references and I should have written
>>
>> tell application "Finder" to set startLoc to (folder "Applications" of startup disk) as alias
>>
>> or this
>> tell application "Finder" to set startLoc to (folder "APOD ƒ" of folder "Pictures" of startup disk) as alias
>>
>>
>> Does this compile in Yosemite ?
>
>
> No, neither.
>
> SCRIPT>
> tell application "Finder" to set startLoc to (folder "Applications" of startup disk) as alias
> try
> display dialog startLoc & return
> on error
> beep
> end try
>
> RESULT>
> tell application "Finder"
> get folder "Applications" of startup disk
> --> alias "Macintosh HD:Applications:"
> end tell
> tell application "Script Editor"
> display dialog {alias "Macintosh HD:Applications:", "
> "}
> --> error number -1700 from {alias "Macintosh HD:Applications:", "
> "} to string
> end tell
> tell current application
> beep
> end tell
It's perfectly logical. You ask display dialog to display an alias which it can't do.
Retry with :
SCRIPT>
tell application "Finder" to set startLoc to (folder "Applications" of startup disk) as alias
try
display dialog (startLoc as text) & return
on error
beep
end try
> SCRIPT>
> tell application "Finder" to set startLocation to (folder "APOD ƒ" of folder "Pictures" of startup disk) as alias
> try
> display dialog startLoc & return
> on error
> beep
> end try
>
> RESULT>
> tell application "Finder" to set startLocation to (folder "APOD ƒ" of folder "Pictures" of startup disk) as alias
> try
> display dialog startLoc & return
> on error
> beep
> end try
>
Same odd instruction give same logical error
anAlias & return remains an alias
(anAlias as text) & return becomes a string
"" & anAlias & return becomes a string
return & anAlias becomes a string.
Yvan KOENIG (VALLAURIS, France) lundi 10 novembre 2014 15:08:53
_______________________________________________
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