Activate Default layer in Quark 7

Hi

I have a script that creates new layers in quark 7.31, names them, sets runaround and locks them.

My problem is that the last layer created is the one that is active/writable (as indicated by the pen icon)

Does anyone know of a way to make the Default layer the selected/active/writable layer?

I have had a look through the QXP Script Library but cannot make anything work!

My script is:-


tell application "QuarkXPress"
	activate
	tell document 1
		set layer1 to make new layer at beginning with properties {visible:true, locked:true, color:{0, 44235, 16400}, name:"New Layer", keep runaround:false, suppress print:false}
		set active layer to "Default"
	end tell
end tell

The error message I get is:

Browser: Firefox 3.0.5
Operating System: Mac OS X (10.4)

Have you tried?

set active layer to layer "Default"

Hi Craig,

Thanks for the reply.

I gave this a go and it compiles and runs without errors, however, it does not make the Default layer the active (or writable) layer.

I cant find any clue in the Quark Scripting Library that indicates this to be possible! It probably isnt. It would just be nice if it could be done. It is no big deal to manually click on the Default layer after all layers have been created.

Thanks again for your help.

That works fine in 6.5 but looks broke in v7.

Here is something to play around with. You need something on the layer to select but it does
change the selected layer to Default.

tell application "QuarkXPress"
	tell document 1
		set selected of every generic box to false
		tell layer "Default"
			set selected of generic box 1 to true
		end tell
	end tell
end tell

Hi Graig,

Thanks again for your post.

I now have:-

tell document 1 of application "QuarkXPress"
	set neLayer to make new layer at beginning with properties {visible:true, locked:true, name:"NE", keep runaround:false, suppress print:false}
	set color of neLayer to {0, 44235, 16400}
	
	set selected of every generic box to false
end tell
tell application "QuarkXPress"
	activate
	tell document 1
		tell layer "Default"
			set selected of generic box 1 to true
		end tell
	end tell
	tell document 1
		tell layer "Default"
			set selected of generic box 1 to false
		end tell
	end tell
	
end tell

It seems as though I have to select a box on the Default layer, end that tell block then start a new tell block to deselect the box. (this doesn’t work if I get it to select then deselect within the same tell block)

Your suggestion has created a solution to this minor annoyance.

Many Thanks.