Unable to rename .pdf file


Hoping that someone can figure out where I’m going wrong here. I created a shortcut previously that was working, but now it is failing to do what I need.

Essentially, I’m trying to take a .pdf file found through multiple means (e.g., PubMed search, Read by QxMD, Google Scholar, etc.) and grab it. Take the file, modify the name (add a text tag to it) and then save it to a Hazel-watched folder on iCloud to then do some more manipulation and filing.

Here’s the script:

Thank you very much for any guidance!

It is hard to debug from a screenshot as they don’t show you the types or properties that have been set. Also you can’t tell where a magic variable is referenced from. You also can’t see any of the additional settings on any of the actions.

Also, to debug properly, we have to enter the shortcut by hand and guess at some of those things above.

Sharing a link to the Shortcut is usually best for these sorts of reasons. Screenshots are absolutely useful, but for programming are often insufficient as they leave gaps and create a time & effort barrier to people who would otherwise try to help.

One thing I can’t make sense of yet is that at the top, it looks like you start working with a variable called Name, but in the screenshot I can’t see where that originates from. That’s the only thing that jumped out at me thus far as looking unusual.

Agree with @sylumer
Seems you’re modifying a variable “name” (guessing from icon that’s the input PDF you manually renamed?).

What I can’t see from the shortcut picture is whether you modify the file itself, or just the variable containing the name.
Can you send a link to the shortcut?

Sorry about that. Here’s a link:


Thank you for all of the assistance.

Thanks. I gave it a run and shared the GoodReader guide PDF via the share sheet to the Shortcut. It gave me the notification (I can now see the details of how you got name),I selected opioid, and it saved the renamed file to the folder like so.

I think this is what you are trying to do and it looks to me like it is working.

So a few of questions.

  1. What is the exact nature of the issue you are seeing occur?
  2. Have you created the destination folder?
  3. What is the original name of your test file?


Thanks for trying it out. I’ll answer your questions and then will attempt to describe the issue I am having. First, I have set up the destination folder in iCloud as a separate folder under the Shortcuts folder.

I am trying to activate the shortcut from the share sheet on a page in Safari that is displaying a .pdf file, which should be the shortcut input.

For example, here is a page that contains a .pdf:

When I activate the shortcut, it gives me a confirmation notification. However, it never renames and saves the file. There is nothing saved in the location specified, and when I change that last step to “ask where to save”, it never prompts me for a location.

Hope that clarifies the issues. Please let me know if there is anything else I can provide you with.

I took a quick look and ended up sticking a Quick Look in at the start to view what was being passed in from Safari. The answer. Nothing!

I tried Chrome, but the shortcut didn’t get listed oddly enough.

I then repeated via iCab Mobile, and I got the same result as from Safari.

I accessed the file via the GoodReader browser and it downloaded it. I share it to the shortcut and it all worked fine from there.

I think there’s some issue somewhere in the sharing PDFs in from a browser. Presumably introduced with iOS14.

Thank you. At least I wasn’t losing my mind . . . Will open a ticket with Apple.