• 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 18:10:39 +0100


Le 2015/12/09 à 17:50, S. J. Cunningham <email@hidden> a écrit :


On Dec 9, 2015, at 8:46 AM, Yvan KOENIG wrote:

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 quoted form of POSIX path of ((sourcefolder as text) & theName)
tell me to set dest to quoted form of POSIX path of ((sourcefolder as text) & theName)
end tell

Well, I get the same error in Snow Leopard so if it's an error, it must have been around for a while.

Steve
------------------

What is puzzling is not the fact that set dest to quoted form of POSIX path of ((sourcefolder as text) & theName)
fails in a System Events block.
I know for months that we aren’t supposed to use OSAX features in a tell application block.
But I know also that Apple explained that 
tell me to  set dest to quoted form of POSIX path of ((sourcefolder as text) & theName)
is THE way to get rid of this rule.

So, the official scheme doesn’t work.
Here, the problem isn’t quoted form as I read in at least an other message, it’s POSIX path as we may see here :

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 quoted form of POSIX path of ((sourcefolder as text) & theName)
tell me to set dest to quoted form of my posixIt((sourcefolder as text) & theName)
end tell
on posixIt(aPath)
return POSIX path of aPath
end posixIt

I will have to look more in depth in my scripts.
After all, maybe I took care of the problem and carefully used small blocks speaking to System Events so that POSIX PATH is not called in such blocks.


Yvan KOENIG running El Capitan 10.11.2 in French (VALLAURIS, France) mercredi 9 décembre 2015 18:10:34





 _______________________________________________
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: I made a nightmare
      • From: Shane Stanley <email@hidden>
References: 
 >I made a nightmare (From: Yvan KOENIG <email@hidden>)
 >Re: I made a nightmare (From: "S. J. Cunningham" <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