Tips & Tricks Part 4: Select Default Layer

Discuss scripting using AppleScript in QuarkXPress 2015, 2016, 2017 & 2018.
Discuss scripting using JavaScript in QuarkXPress 2018.
Post Reply
Posts: 69
Joined: 31 Dec 1969, 19:00

Tips & Tricks Part 4: Select Default Layer

Post by pjanssen » 30 Nov 2016, 08:47

I created some Applescripts, which might be useful for others too. So I wanted to share them here.

The fourth one is for selecting the Default Layer. This one can be changed very easily for selecting another layer. Just exchange "Default" with the name of the layer that needs to be selected.

Code: Select all

set var_LayerNumber to ""
tell application "QuarkXPress"
	set var_LayerNames to name of every layer of document 1
	repeat with i from 1 to count of var_LayerNames
		set var_LayerName to item i of var_LayerNames
		if var_LayerName = "Default" then
			set var_LayerNumber to i
		end if
	end repeat
	tell document 1
		set active layer to layer var_LayerNumber
	end tell
end tell

This script is especially useful if a keyboard shortcut is attached to it.

If you own Keyboard Maestro: more useful macros can be found here: viewtopic.php?f=17&t=28981

Post Reply

Return to “QuarkXPress 20xx: Scripting (AppleScript / JavaScript)”