Recent macros menu

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
TheMarkster
Veteran
Posts: 5512
Joined: Thu Apr 05, 2018 1:53 am

Recent macros menu

Post by TheMarkster »

There is now a recent macros menu group in the Macro menu. It functions similarly to Recent files in the File menu except for macros. A macro gets added to the recent list when it gets created, executed, or opened for editing from within the Macros execute dialog. A shortcut is created for the macros in the form of Ctrl+Shift+1 for the most recently used macro, Ctrl+Shift+2 for the 2nd most recently used macro, etc., up to 9. The default I believe is for 12 macros to be listed and for the 3 most recently used to get the keyboard shortcuts using Ctrl+Shift+ as the modifiers, but it has been a while since I worked on this. This is all configurable in Edit -> Preferences -> General -> Macro tab.

Today I updated the wiki to document this feature. https://wiki.freecadweb.org/Preferences_Editor

Note: if you want to open the macro in the editor rather than execute the macro press the Shift key while clicking the macro in the recent macros menu.
chrisb
Veteran
Posts: 54168
Joined: Tue Mar 17, 2015 9:14 am

Re: Recent macros menu

Post by chrisb »

I've been waiting for this since it was announced. Good to see it in master now.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Recent macros menu

Post by Kunda1 »

It's weird though, in the wiki it the screenshot uploaded to show the Recent Macros preferences, is dated from March 15 2020
So was this feature already in Master since March ?

Edit: nevertheless, this feature is awesome! It has key combos as well! Right on!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
TheMarkster
Veteran
Posts: 5512
Joined: Thu Apr 05, 2018 1:53 am

Re: Recent macros menu

Post by TheMarkster »

The wiki image in March didn't include the macros menu preferences. I only uploaded that file yesterday, which another user updated again later to reduce it's size a little bit. The feature was added to master in the last few days.
mario52
Veteran
Posts: 4690
Joined: Wed May 16, 2012 2:13 pm

Re: Recent macros menu

Post by mario52 »

hi

thanks for this adding,

is it possible to have the same function but for edit the macro (new button in the "Execute macro" window)

or sort by date ...

thanks

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
TheMarkster
Veteran
Posts: 5512
Joined: Thu Apr 05, 2018 1:53 am

Re: Recent macros menu

Post by TheMarkster »

mario52 wrote: Wed Sep 30, 2020 11:06 am hi

thanks for this adding,

is it possible to have the same function but for edit the macro (new button in the "Execute macro" window)

or sort by date ...

thanks

mario
I do not understand. There is already Edit button in Execute Macro dialog. To edit the macro from recent macros (instead of execute) hold Shift key while clicking.
mario52
Veteran
Posts: 4690
Joined: Wed May 16, 2012 2:13 pm

Re: Recent macros menu

Post by mario52 »

hi
TheMarkster wrote: Wed Sep 30, 2020 6:46 pm hold Shift key while clicking.
many thanks (sorry for the noise)

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
freedman
Veteran
Posts: 3465
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Recent macros menu

Post by freedman »

Another thought; If there is only one macro file open then make the Green macro start arrow active, so while you are working on a model you can start the macro without changing screen focus.
freedman
Veteran
Posts: 3465
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Recent macros menu

Post by freedman »

Wow! this is great, works as described. Already using it and saving time.
Thank you
mendy
Posts: 262
Joined: Mon May 21, 2018 2:16 pm

Re: Recent macros menu

Post by mendy »

Hello noticed this post and tried it in a file and the recent macros was showing three that I removed. If I click on a removed one it correctly says File not found and the macro is removed from the list. Deleted all this way and list is empty. (was wondering why a macro I was using wasn't in list but figured out it was because I was launching from created toolbar button, made sense to me). Saved file and on relaunch the recent macros show the 3 macros again. Found in parameter editor removing the three mru's solved that problem. Was trying manually installed macros so I installed one from addon manager and executed it and it showed up in list. Uninstalled with addon manager and it still shows up. Did try edit preferences and set size of recent macro list to 0, apply and restart. List is now clear but if edit preferences and set it back to say 3, apply save and restart they show up as they are still in the parameter editor list. Probably not explaining properly and just noticed because I was trying various macros and removing them versus someone using a stable list. Nice feature does work well did not check if say with a setting of three if new macro use would move them off the list.
Attachments
recmacro.jpg
recmacro.jpg (44.18 KiB) Viewed 2081 times
fnfound.jpg
fnfound.jpg (6.3 KiB) Viewed 2081 times
Post Reply