• 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
problem with POSIX path of …
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

problem with POSIX path of …


  • Subject: problem with POSIX path of …
  • From: Yvan KOENIG <email@hidden>
  • Date: Tue, 13 Sep 2016 16:33:47 +0200

Hello

Here is a subset of a large script I'm working upon.

script o
property tempFolder : "" -- globale
end script

on run
set p2d to path to desktop
set folderName to "transfert_trefsnart"
set o's tempFolder to (path to desktop as text) & folderName & ":"
tell application "System Events"
if not (exists folder (o's tempFolder)) then
make new folder at end of p2d with properties {name:folderName}
end if
end tell
my germaine()
end run

on germaine()


POSIX path of (o's tempFolder) --> "/Users/yvankoenig/Desktop/transfert_trefsnart/"


tell application "TextEdit"
try
log "Point 1"
POSIX path of (o's tempFolder)
on error errMsg number errNbr
log "error #" & errNbr & ", " & errMsg
log "Point 2"
end try
try
log "Point 3"
tell me to get (POSIX path of (o's tempFolder))
on error errMsg number errNbr
log "error #" & errNbr & ", " & errMsg
log "Point 4"
end try
end tell


tell application "System Events"
try
log "Point 5"
POSIX path of (o's tempFolder)
on error errMsg number errNbr
log "As I am in a tell application block I'm not really surprised to get :" & linefeed & "error #" & errNbr & ", " & errMsg
log "Point 6"
end try
try
log "Point 7"
tell me to get (POSIX path of (o's tempFolder))
on error errMsg number errNbr
log "But here, as I use the « tell me » tip, I'm REALLY bored to get :" & linefeed & "error #" & errNbr & ", " & errMsg
log "point 8"
end try
end tell
end germaine

#=====

I don't understand why the good old « tell me » tip doesn't allow POSIX path to behave correctly in a tell application "System Events" block

Here I get this events log :

tell current application
path to desktop
path to desktop as text
end tell
tell application "System Events"
exists folder "SSD 500:Users:yvankoenig:Desktop:transfert_trefsnart:"
end tell
tell application "TextEdit"
(*Point 1*)
(*Point 3*)
end tell
tell application "System Events"
(*Point 5*)
(*As I am in a tell application block I'm not really surprised to get :
error #-1728, Il est impossible d’obtenir POSIX path of "SSD 500:Users:yvankoenig:Desktop:transfert_trefsnart:".*)
(*Point 6*)
(*Point 7*)
(*But here, as I use the « tell me » tip, I'm REALLY bored to get :
error #-1728, Il est impossible d’obtenir POSIX path of "SSD 500:Users:yvankoenig:Desktop:transfert_trefsnart:".*)
(*point 8*)
end tell


What am’I making wrong ?
Of course, I may store the POSIX string in a variable before entering the tell application block but I wish to understand why it behabes this way ?



Yvan KOENIG running El Capitan 10.11.6 in French (VALLAURIS, France) mardi 13 septembre 2016 16:33:39








 _______________________________________________
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: problem with POSIX path of …
      • From: Axel Luttgens <email@hidden>
    • Re: problem with POSIX path of …
      • From: Mitchell L Model <email@hidden>
  • Prev by Date: Ongoing problem with Bill Cheesemans Accessibilty code snippet.
  • Next by Date: Re: problem with POSIX path of …
  • Previous by thread: Ongoing problem with Bill Cheesemans Accessibilty code snippet.
  • Next by thread: Re: problem with POSIX path of …
  • Index(es):
    • Date
    • Thread