• 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: I made a nightmare
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: I made a nightmare


  • Subject: Re: I made a nightmare
  • From: Yvan KOENIG <email@hidden>
  • Date: Wed, 09 Dec 2015 17:01:14 +0100


Le 2015/12/09 à 16:39, 2551 <email@hidden> a écrit :

On 9 Dec 2015, at 20:46, Yvan KOENIG <email@hidden> wrote:

As far as I remember, the initial syntax behaved well in recent past.
Is it a new behavior introduced by 10.11.2 ?

No, not new. I just ran your script on 10.9.5 and it produces the same -1728 error on Mavericks.

Script Editor highlights “quoted form” in the script text as the source of the error.



Best


Phil

Thanks Phil

What is puzzling is the fact that even when I use tell me to, the instruction which works in the handler fails.

set theName to "trucmuche"
--set sourcefolder to (path to desktop as text) & "formoosmahna:" as alias
set sourcefolder to choose folder
tell application "System Events"
if not (exists folder theName of sourcefolder) then
make new folder at end of sourcefolder with properties {name:theName}
end if
-- set dest to my quoteIt((sourcefolder as text) & theName) --> "'/Users/ME/Desktop/formoosmahna/trucmuche'"


tell me # So I'm no longer speaking to System Events


--set dest to ((sourcefolder as text) & theName) --> SSD 500:Users:ME:Desktop:formoosmahna:trucmuche
# Now, the string exists, do EXACTLY what is done in my handler !
--set dest to quoted form of POSIX path of dest --> error "Il est impossible d’obtenir POSIX path of \"SSD 500:Users:ME:Desktop:formoosmahna:trucmuche\"." number -1728 from «class posx» of "SSD 500:Users:ME:Desktop:formoosmahna:trucmuche"


set dest to ((sourcefolder as text) & theName) --> SSD 500:Users:ME:Desktop:formoosmahna:trucmuche
# Split the instruction to identify the wrong doer.
set dest to POSIX path of dest --> error "Il est impossible d’obtenir POSIX path of \"SSD 500:Users:yvankoenig:Desktop:formoosmahna:trucmuche\"." number -1728 from «class posx» of "SSD 500:Users:yvankoenig:Desktop:formoosmahna:trucmuche"


set dest to quoted form of dest
end tell
end tell

on quoteIt(aPath) # Here aPath is a string
return quoted form of POSIX path of aPath
end quoteIt

When I use a single instruction, it’s quoted form which is highlighted but it’s POSIX path which fails and as you may see, the error message make no reference to System Events.


Yvan KOENIG running El Capitan 10.11.2 in French (VALLAURIS, France) mercredi 9 décembre 2015 17:00:43




 _______________________________________________
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: 
 >I made a nightmare (From: Yvan KOENIG <email@hidden>)
 >Re: I made a nightmare (From: 2551 <email@hidden>)

  • Prev by Date: Re: I made a nightmare
  • Next by Date: Re: I made a nightmare
  • Previous by thread: Re: I made a nightmare
  • Next by thread: Re: I made a nightmare
  • Index(es):
    • Date
    • Thread