Drag and drop files into Firefox on schedule

Hello. I have the following situation:

  • i have a folder with a big amount of PDF files.
  • i need to drag and drop PDF files one after another into a specific position (always the same) in Firefox).
  • I need it to be in 2 hour intervals.

So, open Finder, open folder with PDFs, drag first PDF into Firefox, wait 2 hours, drag second PDF into Firefox, wait 2 hours, drag third PDF into Firefox.

How can i achieve this? Thank you.

You've basically laid out the macro you need to build:

I would start by positioning a Finder window (in List or Column view mode) and a Firefox window such that the amount of mouse movement required is as small as possible. I'd also assume I knew how many PDFs I had to drag in a given operation.

Assuming you have that set up, and no other windows can get in the way, I'd write a macro that I launch when I have Finder active and my cursor positioned over the first file. The actions would then look something like:

  1. Repeat Loop N Times, where N = the number of PDFs to be dragged

Then inside the repeat loop:

  1. Set variable local_mousePos to %CurrentMouse%
  2. Move and Click and Drag Mouse at 0,0 from current mouse location to [whatever X and Y values are needed to hit that target in Firefox]
  3. Pause as needed for whatever happens in Firefox to happen
  4. Just Move Mouse, with settings of local_mousePos[1] for → and local_mousePos[2] for ↓ relative to the absolute position. This puts the mouse back where it started.
  5. Just Move Mouse right 0 pixels and down [however many pixels required to move it to the next row in Finder] relative to current mouse location.
  6. Pause action set to two hours.

This macro will need a lot of adjusting, but that's the approach I'd take if I had to solve this problem ... with a big caveat: Many fields in browser windows will accept files in ways other than dragging. For instance, clicking on one will bring up a file selection dialog. If that's the case, it might be easier (less mousing around) to use that method to just walk through a list of files over time.

-rob.

I’m pretty new to the program.

Yes there’s a “select file” link in the Firefox window that opens “select file” window.

Is there some example macro i can use?

You won't find a sample macro that matches what you're trying to do, I don't think, as it's very specific. I assume you can't share the Firefox URL? That would be useful for someone to create a usable test macro for you.

-rob.

Here’s the URL

https://mangatranslator.ai/upload

Thanks; that helped!

This macro might work. I say might because I can't really test it. But it worked for the first test file in my list, at least to the point where I was told I can't upload anything.

What I can't test, and what would probably need adjusting, is what happens after a file is uploaded. If it doesn't go back to that same screen, your macro will have to open the URL again in the loop (probably after the two hour delay) before the loop completes.

Download Macro(s): Safari upload.kmmacros (9.4 KB)

Macro screenshot

Macro notes
  • Macros are always disabled when imported into the Keyboard Maestro Editor.
    • The user must ensure the macro is enabled.
    • The user must also ensure the macro's parent macro-group is enabled.
System information
  • macOS 14.5
  • Keyboard Maestro v11.0.3

To use, edit the green box and enter the slash-delimited path to your folder of PDFs. The macro is designed for Safari, because it integrates very nicely with Keyboard Maestro; it should be editable to work in other browsers, but that's not something I'm able to do for you.

-rob.

Thank you. I will test this and report back