Page 1 of 2

Automation Plugin

Posted: 01 Dec 2009, 18:44
by manison
Automation Plugin will let you execute scripts that will help you automate tasks that are not possible (or difficult) to do with Salamander itself. You can use any language supported by the Windows Script Host to write your scripts. Windows comes with JScript and VBScript engines preinstalled, however 3rd party scripting engines are available for languages such as Perl, PHP, Python, Ruby and others.

Installation
1. Extract the package to the Altap Salamander folder.
2. Go to Altap Salamander > Plugins > Plugins Manager…
3. Click Add.
4. Navigate to the folder containing the plugin and select automation.spl.
5. The plugin is now accessible in the Plugins > Automation menu.

Usage
For information how to run your scripts consult the help accessible from Help > Contents menu and locate the Plugins > Automation topic.
For documentation of the Salamander Object Model please see the Automation Plugin Reference topic in the help.
To explore the sample scripts please go to the plugins/automation/scripts subdirectory of the Altap Salamander installation folder.

This is the initial release of the plugin, the object model is going to be expanded based on the feedback.

UPDATE: Automation plugin is now part of Altap Salamander installation. Download latest Preview Build.

Download[/hide]

Re: Automation Plugin

Posted: 01 Dec 2009, 19:06
by Jan Rysavy
Manison, this looks REALLY promising!

Just yesterday I saw this script: Easier Way to Take Ownership and Grant Access Files or Directories in Vista.

Such scripts could play nicely with your plugin.

Re: Automation Plugin

Posted: 01 Dec 2009, 20:17
by manison
Jan Rysavy wrote:Manison, this looks REALLY promising!
Thank you.
Jan Rysavy wrote:Just yesterday I saw this script: Easier Way to Take Ownership and Grant Access Files or Directories in Vista.

Such scripts could play nicely with your plugin.
Definitely, thanks for sharing.

BTW, don't any of you guys know a reliable way how to get Windows version from within a script?

Re: Get Windows Version

Posted: 01 Dec 2009, 21:57
by th.
I do it like this:

Code: Select all

dim shell, strOS, strVerKey, strVersion
Set Shell = CreateObject("WScript.Shell")
strOS = shell.ExpandEnvironmentStrings("%OS%")
If strOS = "Windows_NT" Then
   strVerKey = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\"
   strVersion = Shell.regread(strVerKey & "ProductName") & " " & Shell.regread(strVerKey & "CurrentVersion") & "." & Shell.regread(strVerkey & "CurrentBuildNumber")
Else
  strVerKey = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\"
  strVersion = Shell.regread(strVerKey & "ProductName") & " " & Shell.regread(strVerKey & "VersionNumber")
End if
MsgBox strVersion
(Source: someone on the internet)

Re: Automation Plugin

Posted: 02 Dec 2009, 03:28
by SelfMan
The system has also a "ver" command.
C:\>ver
Microsoft Windows XP [Version 5.1.2600]

More info about the usage in batch (*.bat/*.cmd) files is HERE.

Re: Automation Plugin

Posted: 02 Dec 2009, 19:39
by manison
Seems good, thank you guys.

Re: Automation Plugin

Posted: 03 Dec 2009, 09:20
by Petr Solin
Great idea! Very nice plugin!

Re: Automation Plugin

Posted: 03 Dec 2009, 10:29
by Jan Rysavy
Manison, what about a new command "Automation Menu" which will display menu with all scripts the same way as User Menu does?
menu.png
menu.png (34.89 KiB) Viewed 23285 times
Just idea based on http://forum.altap.cz/viewtopic.php?f=3&t=818

Re: Automation Plugin

Posted: 03 Dec 2009, 11:48
by th.
Manison, what about a new command "Automation Menu" which will display menu with all scripts the same way as User Menu does?
Hmmm, then we would have 2 menus with "user generated content".
I'd prefer the ability to run a script from the user menu through the automation plugin.

Re: Automation Plugin

Posted: 03 Dec 2009, 12:06
by Jan Rysavy
It could be nice, but cannot be done now, without changing AS core and API. My proposal could be implemented on plugin side only.

Re: Automation Plugin

Posted: 03 Dec 2009, 12:13
by th.
I'm having a problem with the plugin help. I can only access it if i open the automation.chm file directly, and even then the content is not displayed under Content -> Plugins, I can only find it via Index or Search.

I just wrote my first script for the feature mentioned here : http://forum.altap.cz/viewtopic.php?f=3&t=3534 (execute a remote shell on a computer listed by the network plugin). Works great, and now even with a hotkey instead of a context menu entry like with my old solution.

Thanks for the plugin, Manison!

Re: Automation Plugin

Posted: 03 Dec 2009, 12:36
by Petr Solin
When automation.chm is copied to help\english directory of 2.53 beta 1 (PB 38) it works well. Unfortunatelly it cannot work with older versions (e.g. 2.52) because older helps do not contain automation.chm in its [MERGE FILES] section (required by HTML help).

Re: Automation Plugin

Posted: 03 Dec 2009, 12:53
by manison
th. wrote:I'm having a problem with the plugin help. I can only access it if i open the automation.chm file directly, and even then the content is not displayed under Content -> Plugins, I can only find it via Index or Search.
As Petr already mentioned, you need Preview Build 38 to integrate the Automation help smoothly with the Salamander. I can build standalone help file for you for earlier Salamander versions if interested.
th. wrote:I just wrote my first script for the feature mentioned here : http://forum.altap.cz/viewtopic.php?f=3&t=3534 (execute a remote shell on a computer listed by the network plugin). Works great, and now even with a hotkey instead of a context menu entry like with my old solution.
Excellent, thank you for sharing.

Re: Automation Plugin

Posted: 03 Dec 2009, 12:54
by manison
Jan Rysavy wrote:Manison, what about a new command "Automation Menu" which will display menu with all scripts the same way as User Menu does
Nice idea, putting on the to do list.

Re: Automation Plugin

Posted: 03 Dec 2009, 12:59
by th.
Got the PB38 working now. Help is there as expected :D