How to access menu title and item within a macro?

Here you can discuss any topic concerning Far macro commands.
Locked
jonib
Posts: 70
Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden

How to access menu title and item within a macro?

Post by jonib »

Empty forum, Hmm nobody else using macros?

Hi I wanted to automate testing archives so I started making a macro to automatically press enter on MultiArcs "Test archive" command.

But I wanted it to make sure it was the "Test archive" command but I cant find a way to find this information is there a way?

I ended up using this command "Macro:post ShiftF3 $While (Menu) Enter $End" is there a better way?
User avatar
t-rex
Admin
Posts: 417
Joined: Sun Mar 20, 2005 6:10 pm
Location: Ashdod
Contact:

Post by t-rex »

Well, instead of Enter you can write T which is the hotkey for the Test command.
jonib
Posts: 70
Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden

Post by jonib »

t-rex wrote:Well, instead of Enter you can write T which is the hotkey for the Test command.
Thanks, but I was hoping there was a way to get info about the menuitem and/or title like there seems to be for dialogboxes.
User avatar
t-rex
Admin
Posts: 417
Joined: Sun Mar 20, 2005 6:10 pm
Location: Ashdod
Contact:

Post by t-rex »

jonib
Well in the FAR version that I gave you test with the dead keys you can get the title of any object, just use the Title macro-constant.
jonib
Posts: 70
Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden

Post by jonib »

t-rex wrote:jonib
Well in the FAR version that I gave you test with the dead keys you can get the title of any object, just use the Title macro-constant.
Cool 8) works great, is this documented somewhere?

This is my "auto archive testing" macro:
Macro:post ShiftF3 $While (Menu && Title == "Archive commands") t $IF (dialog && substr(Title,0,6) == "Volume") a $End $End

Now should work with archive volumes.
User avatar
t-rex
Admin
Posts: 417
Joined: Sun Mar 20, 2005 6:10 pm
Location: Ashdod
Contact:

Post by t-rex »

jonib
Yes, it's documented - but not yet in english. The latest docs are always here - http://api.farmanager.com/ - they are auto-updated upon a comit to the SVN.
jonib
Posts: 70
Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden

Post by jonib »

t-rex wrote:jonib
Yes, it's documented - but not yet in english. The latest docs are always here - http://api.farmanager.com/ - they are auto-updated upon a comit to the SVN.
I did not find it there so I asked.

Is there a way to get error info why a macro don't work?
User avatar
t-rex
Admin
Posts: 417
Joined: Sun Mar 20, 2005 6:10 pm
Location: Ashdod
Contact:

Post by t-rex »

jonib
Not yet.
Locked