Applescript for Activating GP4 + Instances

Here’s a handy little AppleScript that opens GP4 and iterates through the instances you wish to open with it. Of course, adjust your delay times as needed and change Instance names to match.

Enjoy!

tell application "GigPerformer4" to activate
delay 5 -- Initial delay after activation

-- Define a list of the menu items to iterate through
set menuItems to {"Sprang", "Choir", "Great", "Swell", "Pedal"}

-- Loop through each menu item in the list
repeat with menuItem in menuItems
	tell application "System Events"
		tell process "GigPerformer4"
			-- Ensure GigPerformer4 is the frontmost application
			set frontmost to true
			delay 0.75 -- Give some time for the application to respond
			
			-- Navigate to the "File" menu and then to the "Open Existing Instance" submenu
			tell menu bar 1
				tell menu bar item "File"
					tell menu "File"
						-- Click "Open Existing Instance" to open its submenu
						click menu item "Open Existing Instance"
					end tell
				end tell
				delay 0.25 -- Adjust this delay as needed to ensure the submenu has time to appear
				
				-- Directly click the menuItem within the opened submenu of "Open Existing Instance"
				tell menu item "Open Existing Instance" of menu "File"
					tell menu "Open Existing Instance"
						click menu item menuItem
					end tell
				end tell
			end tell
		end tell
	end tell
end repeat
2 Likes

Some other useful links for Mac users:

1 Like

I have found another way to automate the opening of GP4 and instances. I have a Mac Mini and basically run “headless”. I use the app Shortcuts to create a shortcut that opens my apps at startup. You can set the delays of each item, the trick is to find the file for a second instance. You can find it in you user library. Here is the path to locate the second instance (User/Library/Application Support/GigPerformer/filename).

1 Like