I running on macOS 10.10.5 with Office 2011. I'm having a problem with this macro. I cannot get MacScript to return the POSIX path of a mac file path.
Here is the immediate output.
This statement works as expected in applescript
Code:
Sub tryOut()
Dim cValue As String
Dim thePath As String
Dim allData As String
Dim unixDesktopPath As String
Debug.Print "----------------------------" & Now
cValue = "1.jpg"
thePath = MacScript("return (path to desktop folder) as String")
Debug.Print "thePath is " & thePath
allData = "return ( POSIX path of "
allData = allData & """"
allData = allData & thePath & "numbers:" & cValue
allData = allData & """ ) as String"
Debug.Print "allData is " & allData
' next statement fails :-(
unixDesktopPath = MacScript(allData)
Debug.Print "unixDesktopPath = " & unixDesktopPath
End Sub 'tryOut
Here is the immediate output.
Code:
----------------------------7/29/2019 11:10:45 PM
thePath is Macintosh SSD:Users:mac:Desktop:
allData is return ( POSIX path of "Macintosh SSD:Users:mac:Desktop:numbers:1.jpg" ) as String
This statement works as expected in applescript
Code:
log POSIX path of "Macintosh SSD:Users:mac:Desktop:numbers:1.jpg"
Code:
(*/Users/mac/Desktop/numbers/1.jpg*)