This is my IMatch-Scriptsection!

You can find some (maybe) useful scripts for Mario Westphals IMatch.
IMatch is a very powerfull Image-Management/Database-Software.

If you don't know it, have a look at http://www.photools.com/

 

These Scripts can be used any way, but also without any kind of warranty!

If you don't agree, please leave now.


|  Overview  |  Sitemap  |  Downloads  |   last update: June 12, 2022


newScriptTeaser, a little Winkyman = new Script      updatedScriptTeaser, a little Winkyman = updated Script

DB-Organization:

Multi Database Transmission V 1.2 (06-Jun-2003) - This script transmits Images from a SourceDB to a TargetDB, preserving all Category-Assignments and Property-Entries. (And, *g*, if Mario would give us an updated Timestamp for the DatabaseImageRecords, we could merge Databases by checking which Entry is newer. Think about mobile IMatch.)

Remove Empty Categories from Database V 1.0 (30-May-2003) - This script removes all 'empty'-Categories from the active Database.

OffLineCache Garbage Collector V 1.0 (28-Jun-2003) - This script checks all existing Images in OfflineCacheFolder of the active Database and deletes ownerless OLC-Images. Additionally you can select some Categories from which you want delete the Images OfflineCache-pendants.

 

Image-Manipulation:

Photoshop Conversion (PS 5.5 + 6) V 0.9 (02-Jul-2003) - This Script combines the ManagementPower of IMatch with the ImageManipulationPower of Adobes Photoshop 6.0 in an easy to use way. This Script I have written together with Klaus Schwarzburg. Many thanks for your help, Klaus.

lcms Webgallery Creator V 0.1 (05-Oct-2002) - This script enhance the original Webgallery-Creator-Script with an ICC-Conversion-feature.

little Batch Converter V 1.2 (26-Jun-2003) - This script create resized copies, optionally with ICC-Conversion for Tiff- and Jpeg-sources. Can work with OfflineCacheImages instead of originals and can transmit all Property-, Category- and IPTC-data to the copies.

 

Libs

Registry Functions V 1.0 (01-Nov-2002) - A littleHelper-Script to put and retrieve Data to/from Registry in its correct DataTypes. VB usually provides only the StringType. With this Lib you can store every DataType to Registry (Byte, Integer, Long, Double, Decimal, Boolean, Variant, ...).

Debug Messages V 1.0 (08-Nov-2002) - A littleHelper-Script which handles Debugoutput in Priorityclasses. With this you can have good Informationoutput when you develope a Script and a less or no Output when run the Script in Productivity-Mode. Your DebugmessagePoints can stay in code without any (auswirkung). Usefull for future changes on your code.

 

 


RegistryFunctions

With this Script you can exchange Data with the SystemRegistry.

Who needs this Script?

Everybody who codes own IMacth-Scripts (or VBA-Scripts) and want to store and retrieve values of different Types to/from Registry in an easy way.

You can embedd it in your Scripts as is,
only with one uses-Statement and the definition of two Constants
(the Name of the KeyTree under which your script wants to store Data in Registry).

Because this is a 'helper-Script', there is no MainScript.
In this case the MainScript is only a little example how to use the module.


Explanation
MainScript: hnSample_FncRegKeys.bas
Needed Modules: [hnFncRegKey.obm]



How to use this Script in your Projects:

1) Unzip the package and copy the files to your IMatch Scriptfolder.
In the Scriptfolder itself you find a little SampleScript "hnSample_FncRegKey.bas"
In a Subfolder named hn273 must reside the Libfile:
- hnFncRegKey.obm

2) In every of your Scripts you want to exchange Data with the Registry, you have to embedd the libfile with a Uses-Statement:  e.g.:  '#uses  "hn273\hnFncRegKey.obm".

Also you must define two Public Constants in the DeclarationSection,
the Key-AppName and the Key-SectionName.
e.g.:
Public Const My_RegKeyApp As String = "photools.com\IMatch.3"
Public Const My_RegKeySection As String = "Scripts\TestKeys"

Attention: If you have a Script which uses other embedded Scripts with Uses-Statements and you needs to call RegKeyFunctions from this embedded scripts too, you must embedd the hnFncRegKey.obm in these files too, but you have not to / can not specify the Constants in these files.
The Constants are declared as Public, so they are present in the whole Project.

3) After that you can call the Public Functions of the hnFncRegKey.obm from everywhere in your Script/s.
The Public-Functions are:
 - SaveRegKey
      Saves a Key/Value-Pair to Registry and a second one, storing the original Typedefinition.
 - GetRegKey
      Returns the Value of a given Key converted to it's original VarType. (e.g. Integer, Boolean, Long,...)
 - DelRegKey
      Deletes a given Key.
 - DelAllRegKeys
      Deletes the whole KeyTree.
 - GiveRegKeyArray
      Returns a sorted array with all Keys, optional with TypedefinitionKeys.


Examples

SaveRegKey-Examples

You have to call the Function with a KeyName (as a StringValue) and a Value in any Type.
But because the SaxbasicEngine does not proper recognize which ValueType is given, you best wrapps a VB-ConvertionFunction around your Values.

This is not a must be, but it is more accurate.
If you do not use the VBConversions e.g. 'False' will recognized as Integer 0. Every numeric Value will sorted in one of two recognized groups: Integer or Double. Thats not a lot.

SaveRegKey("MyIntKey",CInt(1024))
This saves a IntegerValue to Registry

SaveRegKey("MyBoolKey",CBool(False))
This saves a BooleanValue to Registry

SaveRegKey("MyStrKey","string")
This saves a StringValue to Registry

SaveRegKey("MyDblKey",CDbl(2653754264))
This saves a DoubleValue to Registry

 

GetRegKey-Examples

If you have stored Data in Registry you want to access them in further Steps of your Script or in next Session of the Script. Therefore you use the GetRegKey-Function. With it you can only retrieve the stored Data or also optionally provide a defaultValue which will used if the Key in Registry does not exist or contains no value. Think about that every script has to run a FirstTime =;).

myStrVar = GetRegKey("MyKey")
myStrVar = GetRegKey("MyKey","defaultStr")

Puts the stored Value of MyKey in myStrVar.
In the second example: If MyKey is empty or does not exist, it puts the defaultvalue to myStrVar!

myBoolVar = GetRegKey("MyKey")
myBoolVar = GetRegKey("MyKey",True)

Puts the stored Value of MyKey in myBoolVar.
In the second example: If MyKey is empty or does not exist, it puts the defaultvalue to myBoolVar!


How does it works?

VB directly can only save values as StringType to Registry.
And this Script is a VB-Script = ;), so we save our values as Strings.

But the Script first determines the ValueType and save this in a second Key (yes, a StringKey too).

If you retrieve a Value, the Script gets the Value and also the Value of the second Key.
The Value will converted to the correct ValueType before served to your variable.
That's all.

A look at the RegistryEditor will show something like:


Additional Informations

The ValueTypes provided by the Script and it's VB-Conversionfunctions:

Byte = CByte(MyVal)
Integer = CInt(MyVal)
Long = CLng(MyVal)
Single = CSng(MyVal)
Double = CDbl(MyVal)
Currency = CCur(MyVal)
Decimal = CDec(MyVal)
Date = CDate(MyVal)
Boolean = CBool(MyVal)
String = CStr(MyVal)
Variant = CVar(MyVal)