• 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
POSIX file behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

POSIX file behavior


  • Subject: POSIX file behavior
  • From: "koenig.yvan" <email@hidden>
  • Date: Sun, 16 Dec 2012 18:18:00 +0100

Hello

I'm accustomed to non fatal errors issued when an OSAX function is called from a tell application wrapper but for the first time, I got a fatal error.

"Macintosh HD:Users:yvankoenig:Desktop:Create a new file from a list.scpt"
set posixPath to POSIX path of result
(*/Users/yvankoenig/Desktop/Create a new file from a list.scpt*)

log POSIX file posixPath
# file "Macintosh HD:Users:yvankoenig:Desktop:Create a new file from a list.scpt"
tell application "Finder"
log my POSIX file posixPath
# file "Macintosh HD:Users:yvankoenig:Desktop:Create a new file from a list.scpt"
POSIX file posixPath
(*
error "Erreur dans Finder : Il est impossible d’obtenir POSIX file \"/Users/yvankoenig/Desktop/Create a new file from a list.scpt\"." number -1728 from file "Macintosh HD:Users:yvankoenig:Desktop:Create a new file from a list.scpt"
*)
end tell

I wrote this awful script for tests.
On entry is a string describing an Hfs+ pathname.
The 2nd instruction build the UNIX path to the file.

As it's out of the tell wrapper, the 3rd instruction behave flawlessly.
When it's preceeded by « my », the same instruction behaves well in the wrapper.
But when I try to use the naked one, I don't get the well known non-fatal error but a fatal one.

I'm a bit surprised because the Script editor display « POSIX file » exactly the same way in the three instructions.
To be sure of that, I changed temporarily the format applied to class of Scripting Additions and the custom format is really applied to the three occurences.

I guess that I am missing something but I don’t guess what.

Yvan KOENIG (VALLAURIS, France) dimanche 16 décembre 2012 18:17:01




 _______________________________________________
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

  • Prev by Date: Re: help needed getting 2nd last line of text
  • Next by Date: Re: iTunes 11 - how does it works with pre existing applescripts?
  • Previous by thread: Re: help needed getting 2nd last line of text
  • Next by thread: How to modify Grid Spacing ?
  • Index(es):
    • Date
    • Thread