Skip to content

Instantly share code, notes, and snippets.

View logic2design's full-sized avatar
🏠
Working from home

Logic2Design logic2design

🏠
Working from home
View GitHub Profile
@logic2design
logic2design / Infopath Form Window Name.txt
Created August 29, 2020 10:34
Sets the window of the Infopath form to the name you specify
function XDocument::OnSwitchView(eventObj)
{
XDocument.View.Window.Caption = "Name of Form";
}
@logic2design
logic2design / Table of Contents (multi columns).vbs
Created September 18, 2020 09:15
Creates a Excel Table of Contents with 1+ columns
Sub TableOfContents_Create()
'PURPOSE: Add a Table of Contents worksheets to easily navigate to any tab (multiple columns)
'SOURCE: www.TheSpreadsheetGuru.com
Dim sht As Worksheet
Dim Content_sht As Worksheet
Dim myArray As Variant
Dim x As Long, y As Long, z As Long
Dim shtName1 As String, shtName2 As String
Dim ContentName As String
@logic2design
logic2design / Rename and File Folder.m
Created September 18, 2020 09:16
Creates Folders with adhoc sub folder structure
tell application "Finder" to set shortName to name of (theFile as alias)
set theDialogText to "What is the Project/Client name? - "
set theButtonContinue to "Save Folder"
set theButtoneAbort to "Cancel"
set theDialogTitle to "Rename Folder"
tell application "System Events"
activate
set theResult to (display dialog theDialogText with title theDialogTitle default answer "" buttons {theButtonContinue, theButtoneAbort} default button 1 giving up after 60)
@logic2design
logic2design / Create Table of Contents.vbs
Created September 18, 2020 09:18
Creates Excel Table of Contents
Sub TableOfContents_Create()
'PURPOSE: Add a Table of Contents worksheets to easily navigate to any tab
'SOURCE: www.TheSpreadsheetGuru.com
Dim sht As Worksheet
Dim Content_sht As Worksheet
Dim myArray As Variant
Dim x As Long, y As Long
Dim shtName1 As String, shtName2 As String
Dim ContentName As String
@logic2design
logic2design / Table of Contents hyperlink Button.vbs
Last active September 18, 2020 17:51
This will create a button on each worksheet linking back to the table of contents. Add to the TOC Vba (without Sub/End Sub) if desired
Private Sub SetTitusClassificationNew(oMailItem As Object, Classification As String)
Dim oProp As Object 'Outlook.UserProperty
Set oProp = oMailItem.UserProperties.Add("TitusAutomatedClassification", 1)
oProp.value = "TLPropertyRoot=AusStandard;Protective Marking=" & Classification
Set oProp = oMailItem.UserProperties.Add("AusStandardProtective Marking", 1)
oProp.value = Classification
End Sub
'The classification argument should be the classification as text ie UNOFFICIAL, UNCLASSIFIED, FOR OFFICIAL USE ONLY etc'
@logic2design
logic2design / Pixelmator Replace Text.applescript
Created September 22, 2020 07:47
Prompts for text replacment in Pixelmator
tell application "Pixelmator Pro"
tell the front document
set theSearchString to text returned of (display dialog ¬
"What text would you like to find?" default answer ¬
"" buttons {"Cancel", "Continue"} default button "Continue")
set theReplacementString to text returned of (display dialog ¬
"What would you like to replace the text with?" default answer ¬
"" buttons {"Cancel", "Continue"} default button "Continue")
replace text theSearchString with theReplacementString
end tell
use scripting additions
tell application "Pixelmator Pro"
tell the front document
if class of current layer = image layer then
set listOfMaskChoices to {"Brights", "Darks"}
set maskChoice to choose from list listOfMaskChoices with prompt ¬
"Choose a luminosity mask:" default items {"Brights"}
if not maskChoice = false then
set temporaryMaskFile to ((path to temporary items from user domain ¬
tell application "Pixelmator Pro"
activate
tell front document
if not (count selected layers) = 1 then
display alert "Make sure a single text layer is selected."
else
if not class of current layer = text layer then
display alert "Make sure a single text layer is selected."
else
set originalVisibleLayers to index of every layer ¬
Public Function HideDatabaseWindow(fHide As Boolean)
'Purpose : Hide or show the database window/navigation pane.
On Error GoTo err_PROC
'Set focus on the database window/navigation pane
DoCmd.SelectObject acTable, "", True
If bolHide Then
DoCmd.RunCommand acCmdWindowHide