Apple launches Apple Store app in India

The Apple Store app provides customers with the most personalized way to shop for Apple’s innovative lineup of products and services. Learn more >

You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Unable to open file with file:// url

Using Apple Mac, silicon, macOS 15.1.1.


I wish to use a URL scheme (file://) to create a link to open files. For example:



  • file:///Users/victor/Desktop/test.txt

or

  • file:///Users/victor/Desktop/test.pdf


I create a link in Reminders in the URL field or in a markdown file but on clicking on the link I get errors such as:


"The application “iA Writer” does not have permission to open “test.pdf”."


or


"The application “Reminders” does not have permission to open “test.pdf”."


Looking at the Sharing and Permissions for these files and the Desktop in Get Info they are all set to Read & Write.


I would be grateful for any help in solving this issue.



Mac Studio (2022)

Posted on Dec 4, 2024 5:35 AM

Reply
3 replies

Dec 4, 2024 7:20 AM in response to vW-MacMiniMBA

Once you have eliminated into the obvious, the Classic problem is that the computer is attempting to open the file you told it to, rather than the one you wanted it to.


You should insert code that shows (on the console?) the fully resolved file-name reference, just before you attempt to open the file. It may show a file-name other than the one you expected.

Dec 4, 2024 11:54 AM in response to vW-MacMiniMBA

From your description, it sounded like you were running these file references inside a script of some description. Otherwise you would select the Icon of the file you wanted and double-click or choose File > Open


Scripts run in a Terminal environment. From Terminal you can make all sorts of references to files, and you can use its 'console'. If you tell Terminal to 'print' something, it will be typically be printed to the console, which defaults to the Terminal window.


if you are NOT using a script, you may need to form your file references differently. I am not quite sure how to show the fully resolved file references. if these are generated automatically, then as they are generated, you should print them out in some fashion.


Perhaps the addition of a hostname such as 127.0.0.1 or Localhost (which are references to THIS computer) would get the url to resolve properly.

Unable to open file with file:// url

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.