Apps Customization
Default File Locations
Program files: Path to Program Files folder\Amethyst Web2App
Skin: Path to Program Files folder\Amethyst Web2App\skin
Apps config:Path to Program Files folder\Amethyst Web2App\apps
Configuration file
The Amethyst Apps configuration settings are in a file named [App Name].ameapp The file can be edited by using Configuration option from the Amethyst App tray menu. The Configuration is divided into sections. Each section has a name in [brackets].
Under the section name, each line contains a single setting, or key, and the corresponding value.
The [App Name].ameapp file has several section:
[Install]
[Window]
[Main Menu]
[SubMenu]
[Alerts]
and individual sections for each config which has been loaded.
Install Section
The Install section contains general settings that can be used to create a custom Amethyst App.
Amethyst can use an ameapp package to install a custom App. The package can hold this additional resources:
Skin Folder with this elements:
Icon file
background.jpg
left.ico
right.ico
pause.ico
refresh.ico
Section Description:
[Install]
AppName: Custom Application name
Icon:Custom application icon
URL:Application main URL
SkinFolder:Skins folder name
Hotkey:The key combination to use as the hotkey. View format keys list.
Example:
[Install]
AppName=AbiCollab
Icon=abiword.ico
URL=https://abicollab.net/
SkinFolder=abicollab
hotkey={F11}
Window Section
Most Configuration begin with the [Window] section.
The Window section contains general settings that can be used to change how Amethyst App behaves. The settings are used as default values for all new configs that are opened. Once the config is opened it will write the settings under its own section in the [App Name].ameapp file.
Some of the settings in the [App Name].ameapp file file cannot be changed while Amethyst App is running becase a refresh will write the old values back to the ini file. If you cannot change something, try changing the value after completely closing Amethyst App.
Section Description:
[Window]
Title: (Optional) The title of the dialog box. (Default: Amethyst - App name)
Width: (Optional) The width of the window. (Default: DesktopWidth - 100)
Height: (Optional) The height of the window. (Default: DesktopHeight - 100)
Border: Defines the border style of the window. Values: Y with Border, N without border (Default: Y)
Transparency: Sets the transparency of a window. A number in the range 0 - 255. The lower the number, the more transparent the window will become. 255 = Solid, 0 = Invisible. (Default: 255)
ToolBarEnable: Enabled Tool Bar, Values: Y, N
ToolBarColor: Background color of the Tool Bar (Default: 0xFFFFFF) View Background colors list.
ToolBarSkin: All tool bar skins are placed in the skin folder. Each skin must be in its own subfolder with the App name. The subfolder may contain this pictures:
left.ico
right.ico
pause.ico
refresh.ico
background.jpg
The names of the images should not be changed. (Default: default)
ToolBarBackground: Enable picture in background, Values: Y, N (Default: N)
ToolBarIconSize: Width and Height in pixels, of each image. (Default: 16)
BrowserWidth: The width of the Browser control (Default: 0, is the previously used width).
BrowserHeight: The height of the Browser control (Default: 0, is the previously used height).
BrowserLeft: The left side of the Browser control. (Default: 0)
ActiveCustomMenu: Enable creates a Menu control for the GUI. Values: Y, N (Default: N)
AlertsUpdate: How often in milliseconds to call the Check Alerts function(Default: 600000)
Example:
[Window]
Title=AbiCollab
Width=
Height=
Border=Y
Transparency=255
ToolBarEnable=Y
ToolBarColor=0xFFFFFF
ToolBarSkin=default
ToolBarBackground=N
ToolBarTextinButton=N
ToolBarIconSize=16
BrowserWidth=0
BrowserHeight=0
BrowserLeft=0
ActiveCustomMenu=Y
AlertsUpdate=600000
Main Menu Section
The Main Menu section contains general settings that can be used to creates a custom Menu control for the GUI.
Section Description:
[Main Menu]
(Menu Type), (The submenu text)=
[The submenu text]
(Menu Type), (The submenu or Item text)= (Action),(Parameter)
Menu Types:
Submenu: Allows you to create a submenu in the referenced menu.
Item: Creates a MenuItem control in the referenced menu.
Action Types:
Amethyst can also be controlled with Actions. An Action is a special command that can be executed when to Menu item is select.
Open: Navigate to the specified URL.
Execute: Runs an external program.
Notification: Displays a toast message.
MsgBox: Displays a simple message box.
Script: Execute an Autoit Amethyst scripting language file (.amescript)
Exit: Quit App.
Example:
[Main Menu]
Submenu, File=
Submenu, AbiWord=
Submenu, Documents=
Submenu, Account=
[File]
Item, Exit=Exit
Item, Open notepad=Execute, notepad.exe
Item, About = MsgBox, Title, Version Info, Message, Version Number
[Documents]
Item, My Documents=Open,https://abicollab.net/documents/index
Item, New Document=Open,https://abicollab.net/documents/create_dialog
Item, Upload Document=Open,https://abicollab.net/documents/upload_dialog
[Account]
Item, Register=Open,https://abicollab.net/user/register
Item, My Account=Open,https://abicollab.net/user/my_account
Item, ChangePassword=Open,https://abicollab.net/user/my_account_password
Item, My Groups=Open,https://abicollab.net/groups/
Item, My Friends=Open,https://abicollab.net/friends/
Item, Add a Friend=Open,https://abicollab.net/friends/add_dialog/
[AbiWord]
Item, Page=Open,http://www.abisource.com/
Item, Plugins=Open,http://www.abisource.com/download/plugins.phtml
Item, Manual=Open,http://www.abisource.com/support/manual/
Alert Section
An Alert is a special command that can be executed when change something in the Amethyst application.
[Alerts]
(Alert Type), (Alert Name)=(Paremeter)
[Alert Name]
Action= (Action),(Parameter)
Alerts Types
TextExist, Verifies that the specified text is somewhere on the page
Scripting
This guide is only meant to help with using AutoIt with Amethyst.
AutoIt is a freeware BASIC-like scripting language, and there are many good sites where you can learn AutoIt itself
The Amethyst API is a COM library that enables you to integrate external applications with Amethyst APPs. It is naturally and easily used with AutoIt, and the syntax and examples in this reference use AutoIt.
An Autoit - Amethyst scripting language file (.amescript) can be executed by Amethyst , passing object with properties from Amethyst Apps to the script.
The script can then be used to get Amethyst Apps properties from the calling script, do any kind of processing outside of Amethyst Apps that you like, and take various actions that impact the Amethyst Apps.
Amethyst has the AutoIt 3.3.6.1 embedded. It contains all the standard libraries and functions that come with AutoIt, but currently cannot be extended by using external libraries.
In the Configuration file
You can execute script file with the Script action
Example:
[File]
Item, Script=Script, c:\test.amescript
In the Script
The first action in any script is get a reference to Amethyst API COM
#include "Path to Program Files folder\Amethyst Web2App\lib\AutoItObject.au3"
;Initializes AutoItObject.
_AutoItObject_Startup()
/*
Amethyst API object.
This object is accessible on whole local machine, not only from this script.
*/
Local $objAPI = _AutoItObject_ObjCreate("cbi:{D07F2CEA-696F-47CD-99A9-D31E3641169A}")
The API GUID is specified in the configuration file. The GUID is unique by Application
[Scripting]
AppPid=3456
GUID={D07F2CEA-696F-47CD-99A9-D31E3641169A}
You can interact with the application through the IE.au3 library.
Examples:
Local $objIE = $objAPI.APP
;Navigate to the specified URL.
_IENavigate ($objIE, "http://www.autoitscript.com/forum/index.php?")
;Returns a select property of the Amethyst APP or DOM element.
_IEPropertyGet ($objIE, "outertext")
/*
Get a reference to a specific form element by 0-based index and submit.
*/
$oForm = _IEFormGetCollection ($objIE, 0)
$oQuery = _IEFormElementGetCollection ($oForm, 2)
_IEFormElementSetValue ($oQuery, "Insert Text")
_IEFormSubmit ($oForm)
Amethyst API object
Amethyst API object exposes the following public properties:
Properties | Description |
---|---|
HTML | Returns the full HTML source of a document. |
BODY_TEXT | Returns the Text inside the body tag of the document. |
BODY | Returns the HTML inside the body tag of the document. |
URL | Retrieves the URL of the resource that Amethyst App is currently displaying. |
HOME | Retrieves the main URL for the Amethyst App. |
ID | Object identifier. String representation of GUID. |
APP | Object variable of an InternetExplorer.Application Amethyst App. |
InstallPath | Path to Amethyst application data. |
Amethyst API object exposes the following public methods:
Methods | Description |
---|---|
Notification | Displays a notification message box with optional timeout. |
Example:
Need more examples? See the Apps catalog.
AutoIt IE.au3 library
_IEAction
_IEBodyReadHTML
_IEBodyReadText
_IEBodyWriteHTML
_IEDocGetObj
_IEDocInsertHTML
_IEDocInsertText
_IEDocWriteHTML
_IEErrorHandlerRegister
_IEErrorNotify
_IEFormElementCheckBoxSelect
_IEFormElementGetCollection
_IEFormElementGetObjByName
_IEFormElementGetValue
_IEFormElementOptionSelect
_IEFormElementRadioSelect
_IEFormElementSetValue
_IEFormGetCollection
_IEFormGetObjByName
_IEFormImageClick
_IEFormReset
_IEFormSubmit
_IEFrameGetCollection
_IEFrameGetObjByName
_IEGetObjById
_IEGetObjByName
_IEHeadInsertEventScript
_IEImgClick
_IEImgGetCollection
_IEIsFrameSet
_IELinkClickByIndex
_IELinkClickByText
_IELoadWait
_IELinkGetCollection
_IELoadWaitTimeout
_IEPropertyGet
_IEPropertySet
_IETableGetCollection
_IETableWriteToArray
_IETagNameAllGetCollection
_IETagNameGetCollection
Hotkey | Resulting Keypress |
---|---|
{!} | ! |
{#} | # |
{+} | + |
{^} | ^ |
{{} | { |
{}} | } |
{SPACE} | SPACE |
{ENTER} | ENTER key on the main keyboard |
{ALT} | ALT |
{BACKSPACE} or {BS} | BACKSPACE |
{DELETE} or {DEL} | DELETE |
{UP} | Up arrow |
{DOWN} | Down arrow |
{LEFT} | Left arrow |
{RIGHT} | Right arrow |
{HOME} | HOME |
{END} | END |
{ESCAPE} or {ESC} | ESCAPE |
{INSERT} or {INS} | INS |
{PGUP} | PageUp |
{PGDN} | PageDown |
{F1} - {F12} | Function keys |
{TAB} | TAB |
{PRINTSCREEN} | Print Screen key |
{LWIN} | Left Windows key |
{RWIN} | Right Windows key |
{NUMLOCK on} | NUMLOCK (on/off/toggle) |
{CAPSLOCK off} | CAPSLOCK (on/off/toggle) |
{SCROLLLOCK toggle} | SCROLLLOCK (on/off/toggle) |
{BREAK} | for Ctrl+Break processing |
{PAUSE} | PAUSE |
{NUMPAD0} - {NUMPAD9} | Numpad digits |
{NUMPADMULT} | Numpad Multiply |
{NUMPADADD} | Numpad Add |
{NUMPADSUB} | Numpad Subtract |
{NUMPADDIV} | Numpad Divide |
{NUMPADDOT} | Numpad period |
{NUMPADENTER} | Enter key on the numpad |
{APPSKEY} | Windows App key |
{LALT} | Left ALT key |
{RALT} | Right ALT key |
{LCTRL} | Left CTRL key |
{RCTRL} | Right CTRL key |
{LSHIFT} | Left Shift key |
{RSHIFT} | Right Shift key |
{SLEEP} | Computer SLEEP key |
{ALTDOWN} | Holds the ALT key down until {ALTUP} is sent |
{SHIFTDOWN} | Holds the SHIFT key down until {SHIFTUP} is sent |
{CTRLDOWN} | Holds the CTRL key down until {CTRLUP} is sent |
{LWINDOWN} | Holds the left Windows key down until {LWINUP} is sent |
{RWINDOWN} | Holds the right Windows key down until {RWINUP} is sent |
{ASC nnnn} | Send the ALT+nnnn key combination |
Hotkey | Description |
---|---|
Ctrl+Alt+Delete | It is reserved by Windows |
F12 | It is also reserved by Windows, according to its API. |
NumPad's Enter Key | Instead, use {Enter} which captures both Enter keys on the keyboard. |
Win+B,D,E,F,L,M,R,U; and Win+Shift+M | These are built-in Windows shortcuts. Note: Win+B and Win+L might only be reserved on Windows XP and above. |
Alt, Ctrl, Shift, Win | These are the modifier keys themselves! |
Other | Any global hotkeys a user has defined using third-party software, any combos of two or more "base keys" such as '{F1}{F2}', and any keys of the form '{LALT}' or '{ALTDOWN}'. |
Colors are displayed combining RED,GREEN, and BLUE light.
Colors are defined using a hexadecimal notation (HEX) for the combination of Red, Green, and Blue color values (RGB).
HEX values are specified as 3 pairs of two-digit numbers, starting with a Ox sign.
Examples:
0xFF0000 red
0x0000FF blue
0xC0C0C0 grey
0x000000 black
0xFFFFFF White
0x249024 pink
0xA6CAF0 blue gray
0xFFCC00 orange
0xA6CAF0 blue