• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ongoing Senior moments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: ongoing Senior moments
      • From: Robert Poland <email@hidden>
References: 
 >ongoing Senior moments (From: Robert Poland <email@hidden>)
 >Re: ongoing Senior moments (From: Luther Fuller <email@hidden>)
 >Re: ongoing Senior moments (From: Robert Poland <email@hidden>)
 >Re: ongoing Senior moments (From: Christopher Stone <email@hidden>)
 >Re: ongoing Senior moments (From: Robert Poland <email@hidden>)
 >Re: ongoing Senior moments (From: Luther Fuller <email@hidden>)
 >Re: ongoing Senior moments (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: ongoing Senior moments
  • Next by Date: Re: ongoing Senior moments
  • Previous by thread: Re: ongoing Senior moments
  • Next by thread: Re: ongoing Senior moments
  • Index(es):
    • Date
    • Thread