Filling fields in a "Save as " Dialog

Hi
I am trying to automate the "Save archive" Option of a Database.
There isn't a short cut, but I recorded the actions and now I do get to the point where there is a Dialogue and I know I an use the "Click Button" command to click on "Save"... but there are a couple of things that I need help on...

  1. I would like to replace the name of th file by a new one... i.e. assume the file is fileName and I simply want to append the string "backup%ShortTime%"
    I created that variable... but
    Q: how to I read the "Save as" field (because I want to use the existing name and just append the text) so that I replace it with the appended one?

  2. if I wanted to add a Tag..
    **Q: how would I enter it in the Tag field in the dialogue?

sorry if they obvious...
thanks

Luis

an update.... to be clear on where I am and what is not working
I used a convoluted (?... or is it so?) way by moving the mouse the position where the dialogue is displayed and then triple click to select it all.

But the issue is that I can't copy the name... the Command Copy, Control-C etc do not work...
So I decided to use "right Click"... which works... and then select "Copy" ... but I don't know how to read from a contextual menu

any hints please? is there any way than moving the mouse "specifically to the point"?
and then the context menu?

cheers
Luis

If you want help, you have to give us a few more clues:-

a: what software are you using?
b: do you know what type of database?
c: is there a drop down menu as in say textedit or pages that gives you
File > Save or SaveAs option?

Hi
ok... np, just thought that the answers were not dependent on those items... but here it goes :slight_smile:

  • this is Ninox... (can be seen in the screen shot)
  • I am not using the cloud version so there are no APIs...
  • as mentioned: the Menu doesn't have a shortcut ... the Menu is "Database" and then there are several options... one of them is "Save Archive As.." (no short cut) and that brings the screenshot I have attached

that is why I used

  • move the mouse, then triple click etc etc... but one can not do copy of the name ... (doesn't matter if it is through triple click to select all, or select all, or click and drag)

Therefore my questions...
This is sa standard OSX Dialog... so
How can I read the fields?
And if I use right mouse click... is there a way to use contextual commands? (the copy in this case)

thanks

Can you use this KM action command at all?

https://wiki.keyboardmaestro.com/action/Select_or_Show_a_Menu_Item

This is how I've done it in the past....

This bit of a macro should be placed after you've just done the triple-click to select the file name in the Save As dialog:

It first does the right click and pauses until the contextual menu shows and then it just types "Copy" followed by return. This places the filename that has been selected by the triple-click into the system clipboard. My macro then just displays the name, but you would transfer it into a variable and then append the extra stuff.

The image it is pausing for is this:

which is just that part of the contextual menu you need to work with.

Here's the macro in full... Save As Test.kmmacros (29.7 KB)

Hope you can use this to fill out your requirements! Good luck.

Have you tried using a simple KM Copy Action?

you can easily test with a simple macro:

image

Give that a test. It should display the suggested file name without the extension.

If that works then all you need is:

image

Please let us know if that works for you.

YES!!!!!! :slight_smile: :slight_smile:
that's it! the COPY Return by Typing is the Gold Solution

I added then a search for a substring with regular expression and it works perfectly

Brilliant!
Many thanks !

Hi
thanks for the time to answer me.
Yes I tried the Copy... but it doesn't work in the Menu... that is why I had to go to the contextual menu and try the Copy and this is where tiffle's solution did the trick

cheers!

Great stuff @luis - shame @JMichaelTX‘s suggestion didn’t work as it would have been far more robust.

Well done team :slight_smile: