Чтобы узнать местоположение папки, когда Safari загружает файл?

15216
ohho

Существует ли расширение Safari, позволяющее пользователю выбирать другое местоположение папки при каждой новой загрузке?

6
Вы нашли расширение Safari? ricbax 13 лет назад 1

4 ответа на вопрос

8
ricbax

Единственный известный мне способ позволяет выбрать определенную папку для каждой загрузки файла, удерживая controlи щелкая ссылку. Появится меню и выберите «Загрузить связанный файл как ...»

Мне сказали, что вы можете установить что-то, известное как «Действия с папкой», которое позволяет вам создавать сценарий для определенных расширений файлов, и после загрузки файла в папку по умолчанию сценарий запускается и помещает файл в указанную вами папку. в сценарии.

1
Matthew Miller

I hate this "feature" of Safari, too. But I love Safari's other features enough that I figured out a work-around, until Apple comes to their senses and adds it.

This workflow is designed to ask me where to save a downloaded file, then show me the folder into which it was moved (so I can see the file name) and allow me to change the filename if I want. I need this because several of the sites from which I usually download have long randomly generated file names which are useless, so I need to rename files immediately. If you don't need or want either of those features in your workflow, you can skip adding the second and third actions and just use the Move Finder Items action.

Here's what I do:

  1. Open the Automator tool (you don't have to know any code to use it).
  2. Create a new "Folder Action" type document.
  3. Assign the Folder Action to the Downloads folder.
  4. Add these actions (in order): Move Finder Items, Reveal Finder Items, Name Single Item.
  5. Set the "Move Finder Items" action to use the Downloads folder as it's default (or whichever folder you are most likely to move things to - I use Downloads because most of the time I'm moving files into an archive structure and want it to be easy to skip this process by just hitting Return and leaving the file in Downloads when I don't do that.)
  6. Open the options for the "Move Finder Items" action and tick the checkbox for "Show this action when the workflow runs."
  7. Open the options for the "Name Single Item" action and tick the checkbox for "Show this action when the workflow runs."

Save your file & test.

Good luck!

0
manicaesar

I've also used Automator but in some other manner. It does not work as a charm due to Automator limitations / bugs / long load time, but well, at least it works :D

What this script does is simply stores into variable which files were added to "Downloads" folder, then ask user where to move them, stores the answer into another variable and then combine two variables to move the files to proper destination.

  1. Open the Automator tool.
  2. Create a new "Folder Action" type document
  3. Assign the Folder Action to the Downloads folder
  4. Now add following items in the given order:
    • "Set Variable value" and set it for "Files" variable (create new variable for it).
    • "Ask for Finder Items". Give it proper prompt (e.g. "Choose destination folder") and starting place (I selected home directory). Set expected type to "Folders". Ignore input for the action by selecting checkbox in Options of the action.
    • "Set Variable value" and set it for "Destination Path" variable (create new variable for it). It will store the destination path into variable for future use.
    • "Get Variable value" and set it to retrieve "Files" variable. Ignore input for the action by selecting checkbox in Options of the action.
    • "Move Finder items" and set destination path for it to be variable "Destination Path".

Then save it in Automator. Now, everytime something is added to "Downloads" folder, Automator will run above workflow.

The problem is that the prompt for destination folder does not show up in the front, but in the back :/ So it is easy to forget about it. Thus, I extended my script to play system sound just before asking for destination folder. However playing system sound is not available in Automator actions library by default. You can download it here: http://www.macosxautomation.com/automator/examples/actions.html GL&HF!

0
ADW

Подход Мэтью Миллера работает хорошо, если ваша цель состоит в том, чтобы изменить длинные имена на что-то более запоминающееся.

Но в других браузерах я иногда выбираю другое имя, чтобы избежать перезаписи существующего файла. Последовательность Мэтью перемещает файл, а затем переименовывает его, поэтому существующий файл будет перезаписан до изменения имени (или перемещение не будет выполнено, если вы не отметили флажок перезаписи).

Если вы измените порядок действий Automator следующим образом: Выявить элементы поиска, Имя отдельного элемента, Переместить элементы поиска

файл переименовывается в папку «Загрузки», а затем перемещается.

Обратите внимание, что вы должны переименовать файл, иначе перемещение не произойдет. Если я не хочу давать ему новое имя, я изменяю расширение на то, что оно уже есть ..