How do I open a OneDrive file in Preview using Applescript?
-
29-04-2021 - |
Pergunta
How do I open a OneDrive for Business file using Preview using Applescript? I’ve tried this so far:
tell application "Preview" to open POSIX file "Users/myname/One Drive - MySchoolOrCompany/path/to/file"
However, I get this error message from Preview (filename
is the name of my file):
The file “filename” couldn't be opened because there is no such file.
I have checked and the file path is correct.
Solução
I figured it out. I didn't have a forward slash before Users
:
tell application "Preview" to open POSIX file "/Users/myname/One Drive - MySchoolOrCompany/path/to/file"
Licenciado em: CC-BY-SA com atribuição
Não afiliado a apple.stackexchange