coding

AI Script – Sort Layers Alphabetically

Illustrator Script Sort application active document layers alphabetically /*#target illustrator*/ main(); function main(){ if(!documents.length) return; var doc = app.activeDocument; var allLayers = app.activeDocument.layers; var visibleLayers = []; for(a=0; a<allLayers.length; a++){ var ilayer = allLayers[a]; if (ilayer.visible) { visibleLayers.push(ilayer); } }; var alphabetizedLayers = visibleLayers.sort( function(a,b) { return a > b } ); sort_layers(doc, alphabetizedLayers); } […]

AI Script – Sort Layers Alphabetically Read More »

VBScript Download flag SVG files from a website

Visual Basic Script Here is a VBScript script to download flag SVG files from a website and save them in a directory Set xml = CreateObject(“MSXML2.ServerXMLHTTP.6.0”) Set fso = CreateObject(“Scripting.FileSystemObject”) Set shell = CreateObject(“WScript.Shell”) urlTemplate = “https://commons.wikimedia.org/wiki/Special:FilePath/Flag_of_{country}.svg” outputFolder = shell.CurrentDirectory & “\flags” countries = Array(“Afghanistan”, “Albania”, “Andorra”, “Angola”, “Antigua and Barbuda”, “Argentina”, “Aruba”, _ “Bahamas”,

VBScript Download flag SVG files from a website Read More »

Vizrt On Air Get Info

Attach this script code on a container with a Text plugin dim content as String sub OnInitParameters() RegisterPushButton(“view”, “View report”, 1) RegisterPushButton(“clean”, “Clear report”, 2) end sub sub OnExecAction(buttonId As Integer) if buttonId = 1 then this.Geometry.Text = “” Query(“ONAIR GET_INFO”, “ONAIR Infos”) Query(“VERSION”, “”) Query(“KEY GET SYSID”, “Dongle ID”) Query(“KEY GET INFO”, “License Details”)

Vizrt On Air Get Info Read More »

Vizrt Get NLE Mode

Attach this script code on a container with a Text plugin sub OnInit() If System.SendCommand(“GLOBAL*NLE_MODE GET”) = “0” Then this.geometry.text = “PGM” Else this.geometry.text = “PREVIEW” End If end sub  

Vizrt Get NLE Mode Read More »

Vizrt Renderer Snapshot

Attach this script code on a container with a Text plugin and a ControlText plugin sub OnInit() This.Geometry.RegisterTextChangedCallback() end sub sub OnGeometryChanged(geom As Geometry) snapMe() end sub Sub snapMe() If this.geometry.text<>”” Then dim snapPath as Array[string] this.geometry.text.split(“;”, snapPath) if snapPath[0] = “SNAP” then system.sendCommand(“RENDERER SNAPSHOT ” & snapPath[1]) end If End If end sub  

Vizrt Renderer Snapshot Read More »

VTW Color Picker

Script Dim PosX, PosY Dim colorPicker Sub ImageMouseDown(Sender, Button, Shift, X, Y) PosX = X PosY = Y End sub Sub ImageOnClick(Sender) colorPicker = Sender.Canvas.Pixels(PosX, PosY) txtCCColor.Text = ConvertToCColor(colorPicker) txtRGBColor.Text = ConvertToRgb(colorPicker) txtRGBColor.Color = colorPicker txtCCColor.Color = colorPicker End sub Function ConvertToRgb(color) Dim red, green, blue, temp temp = color red = temp Mod &H100

VTW Color Picker Read More »

VTW Color Chart Selector

Script Sub InitForm loadColors() End Sub Class ColorsObj Public codeColor Public hexaColor Public rgbColor Public vtwColor End Class Dim arrColors() EmptyArray() Sub EmptyArray() ReDim arrColors(0) Set sObj = new ColorsObj sObj.codeColor = “” sObj.hexaColor = “” sObj.rgbColor = “” sObj.vtwColor = “” Set arrColors(0) = sObj End sub Sub loadColors() Erase arrColors Set XMLColors =

VTW Color Chart Selector Read More »

VTW Color Dialog Picker

Script Sub BtnColorsClick(Sender) If ColorDialog1.Execute then temp = ColorDialog1.Color red = temp Mod &H100 temp = temp \ &H100 green = temp Mod &H100 temp = temp \ &H100 blue = temp Mod &H100 rvb.Text = red & ” ” & green & ” ” & blue rvb01.Text = red/255 & ” ” & green/255

VTW Color Dialog Picker Read More »

Vizrt Set x and y coordinates to .txt file

dim x, y as Integer sub OnInitParameters() RegisterPushButton(“action”, “Get Childs position x y”, 1) end sub sub OnExecAction(buttonId As Integer) dim n As Integer dim StreamText as String dim TextPath as String = “<full path of .txt file>” for n = 1 To this.ChildContainerCount dim c as Container = this.GetChildContainerByIndex(n-1) c.GetScreenPositionOrtho(x, y) StreamText &= x

Vizrt Set x and y coordinates to .txt file Read More »

Shopping Cart