Hello All, I have had some help in the past with UI scripting to convert RGBa images to Palette. I am hoping to do similar scripting so as to register an image with CPs to a vector grid drawing with the same CPs. My current process involves picking the CPs in both the image and the drawing which is no prob. I just want to script the actual registration process of a folder full of these images. The biggest challenge may actually be figuring out how the script would know which vector file to use for each image in the folder. Perhaps having similar filenames or something like that. The controls I believe the new script will need are: ComboBoxReference (vector source with CPs) ComboBoxMethod (Numeric) TextBoxOrder (3) My other script which I was hoping to build on in included below if anyone is interested. Thanks for any help. *************************************************************** ' Grmapper - Feb 09, 2013 ' With help from TJHP and the Manifold User Community ' Thanks everyone ' ' Script converts all images in a folder to Palette 256 ' using UI scripting Set app = Application Set doc = Application.ActiveDocument Set cmp = doc.ComponentSet(folderName) set cset = Application.ActiveDocument.ComponentSet folderName = app.InputBox("Enter Data Folder","","Images") Sub DoSomething(cmp) Dim fileChar fileChar = cmp.Name Set ui = Application.UserInterface If cmp.Type = ComponentImage Then Document.ComponentSet(fileChar).Open ui.InvokeCommand "ImageConvertTo" '*************************************************** 'When using UI scripting, it's best to treat all lines 'of your script as if they were issued to Manifold asynchronously. 'If operation B depends on operation A, it's not enough to issue 'instruction B after instruction A. You have to test whether A 'has completely before attempting B. Sometimes the effective 'execution order can look *very* strange. Almost as if "Run is 'separate thread" means "Run each line its own thread". 'Above provided by TJHB at http://www.georeference.org/forum/t118443.7 Do ' Nothing Loop Until ui.DisplaysModalDialog Do ' Nothing Loop Until ui.ModalDialog.Caption = "Convert To" '**************************************************** Set dlg = ui.ModalDialog dlg.ControlSet("ComboBoxTarget").Text = "Palette" dlg.ControlSet("ComboBoxPalette").Text = "Adaptive" dlg.ControlSet("TextBoxColors").Text = "256" dlg.Accept Application.WindowSet.ActiveWindow.Close ElseIf cmp.Type = ComponentFolder Then For Each child In cmp.Children DoSomething child Next End If End Sub Sub Main DoSomething Application.ActiveDocument.Componentset(folderName) End Sub
|