Macros to automate the UI

We welcome any suggestions for new features or improvements in Altap Salamander. Please post one suggestion per report.
Tomcat
Posts: 44
Joined: 28 Apr 2006, 17:21

Macros to automate the UI

Post by Tomcat »

It would be nice if Sala would support macros. For a start several keystrokes could be summed up under one macro.
It should be possible to place a macro in the user menu and to assign a macro to a key (or a combination like Ctrl+F). If this shortkey is already defined it should override the default settings. This way the existing functions could be enhanced / changed to someones preferences.

Here some examples how to solve some feature requests with macros:

Always queue copy/move operations has been requested several times e.g also here.
Overwriting <F5> with <F5><ALT+W> does the trick.

Quick Rename pre-selecting filename without extension could be solved with the macro <F2><SHIFT+CTRL+LEFT><SHIFT+LEFT> assigned to the <F2> key. In general several productivity tips could be further simplified with macros.

The macros should allow to use the variables that are available for user menu entries like $(Name), $(FullPath) and so on. This would allow to address requests like Shift+F4... use name-part from selected file
what could be easily achieved with <SHIFT+F4><$(NamePart)>.txt.

Another nice enhancement would be a feature to call an external program and to digest its output. Imagine you have a little C#, VB, Perl, whatsoever program called today.exe that writes the current date to stdout in your preferred format. Then something like <F2><CTRL+LEFT><LEFT>_<exec:C:\MyTools\Today.exe> would add today's date to the filename. Also here variables should work, e.g. <exec:Mytool.exe $(FullPathLeft)>

This "Meta-Feature" could serve as a poor man's SDK and IMHO would significantly increase the flexibility of the user interface.
RocknRoller

AutoHotkey?

Post by RocknRoller »

You should consider using a program like AutoHotkey for that.

It's very easy to implement the kind of macros you need with AHK.
Tomcat
Posts: 44
Joined: 28 Apr 2006, 17:21

Post by Tomcat »

Well, I was looking for something inside Sala to replace external tools like AHK. I know the power of AHK but I do not use it, because
  • - I don't like the idea that a resident program monitors all my UI activities only to act on some keypresses I do in Salamander
    - I once tried AHK and had sporadic system hangs (most probably due to a bug in my script but anyhow I stopped using it)
I think that UI macros within Salamander would be useful, because
  • - Also other people may not like AHK for whatever reason
    - Scripting tools like AHK may be regarded as a security hazard in company networks and may not be permitted to use
    - A solution within Salamander may be regarded as more reliable, trustworthy and easy to use
    - It would make a nice entry in the feature list from the marketing perspective (this stuff has this flexibility/customizability flavor that some users may like)
I think that it depends on the internal program architecture, if this suggestion should be considered. If it is easy to implement, why not. If this would be difficult, then IMHO the effort is better directed to the SDK.
jerrydf
Posts: 2
Joined: 08 Jan 2007, 03:20

Post by jerrydf »

I agree with Tomcat's post above. I too would like to be able to create macros in Sala.
Jerrydf
JohnFredC
Posts: 162
Joined: 10 Dec 2005, 15:44

Post by JohnFredC »

I hope the Salamander Team will put more urgent emphasis on folder tabs with private trees and on more custom columns.

That said, I too think that a scriptable Salamander would be great! The key would be a proper object model and useful methods. For instance, I would like to be able to script something like the following:

Code: Select all

Sub EnterFolder(AnyFolder)
   Dim FileMask$
   FileMask$ = "*.jpg;*.png;*.bmp"
   If Salamander.ActivePanel.CurrentFolder.CountFiles(FileMask$)/ActivePanel.CurrentFolder.CountFiles("*.*")>.60 then
      Salamander.ActivePanel.ViewMode="Thumbs"
      Salamander.ActivePanel.GotoFile(Salamander.ActivePanel.Items(1))
      Salamander.QuickView.Show
      Salamander.ActivePanel.Repaint
   Else
      Salamander.ActivePanel.ViewMode="Details"
      Salamander.QuickView.Hide
      Salamander.Repaint
   End If
End Sub
This script calculates the proportion of image files in a folder. If the folder contains greater than 60% image files, switches to Thumbs mode and shows the QuickView panel.
Mouse-centric, Registered
User avatar
frax
Posts: 58
Joined: 23 Apr 2007, 07:24
Location: Stockholm, Sweden
Contact:

Post by frax »

I am an autohotkey user, and I would love to see some way to script more features of the salamander interface from AutoHotkey. Some bindings or hooks, or whatever they are called!
Post Reply