script/App Folder?

Hello, I have constructed a script that works fine from my desktop, but once I add it to the QuarkXPress scripting folder it will not activate. Somewhat new to all of this, so any input will be most appreciated. Thanks.

Will you post the script? Will you elaborate on “it will not activate” ?

Here is the script that works fine from the desktop, but once I move it to the Quark folder and attempt to run from the scripts file it does not work.

set pathToDesktop to “Macintosh HD:Users:kirk:Desktop”

property qxpObjFIle : “/Volumes/tlib/qxp/qxpObjects.scptd”
property progressBarHandler : “/Volumes/tlib/gui/BPhanlder.scptd”
property pdfStyles : {“CaptureSettings”}
property iconIndexFIle : “/Volumes/tlib/gui/iconIndex.scptd”

global ProgressBar, pbImage

set pdfExportOptions to {Hyperlinks:“off”, Compression:“on”, ColorImages:“resolution”, Downsample:91, GrayscaleImages:“resolution”, color:“on”, Mode:“Separations”}

set qxpObj to (load script (POSIX file qxpObjFIle))
set iconIndex to load script (POSIX file iconIndexFIle)
set pbImage to iconIndex’s getIcon(“acrobat”)

tell application “QuarkXPress”
activate
if not (exists document 1) then
error “no document open”
end if
set allProjects to qxpObj’s getProjectNames()
set thisProject to item 1 of allProjects
set projectName to thisProject’s projectName
set pdfName to projectName & “.pdf” as string
set currentLayout to thisProject’s currentLayout
set layoutCount to count of thisProject’s layoutNames

end tell

tell application “QuarkXPress”
activate

tell application "System Events" to tell process "QuarkXPress"
	click menu item "Layout as PDF..." of menu 1 of menu item "Export" of menu 1 of menu bar item "File" of menu bar 1
	delay 1
	keystroke "tempname"
	delay 1
	keystroke "G" using {shift down, command down}
	delay 1
	keystroke "PathToFolder"
	delay 1
	click button "Go" of sheet 1 of window "Export as PDF"
end tell
repeat 2 times
	delay 3
	activate
	tell application "System Events" to tell process "QuarkXPress"
		try
			if exists button "OK" of window 1 then
				click button "OK" of window 1
			end if
		end try
	end tell
end repeat
delay 3
tell application "System Events" to tell process "QuarkXPress"
	try
		click button "Save" of window "Export as PDF"
	end try
end tell
repeat 4 times
	delay 1
	activate
	tell application "System Events" to tell process "QuarkXPress"
		try
			if exists button "OK" of window 1 then
				click button "OK" of window 1
			end if
		end try
		try
			if exists button "List Profiles" of window 1 then
				click button "Continue" of window 1
			end if
		end try
	end tell
end repeat
delay 2

end tell

After all of 2 minutes on the Quark AppleScript forum I found a post which suggests there may be a problem with the Quark Script menu itself.

Please confirm: You can see your script in Quark’s Script menu, but selecting it does nothing?
What exactly did you put there: applet (.app extension) or script (.scpt or .scptd)?
Usually .scpt files are put in such a menu, and I have no idea whether applets or script bundles would work as well, and always.
“Running from the desktop”: does that mean running as applet (by doubleclick) , or as script (from the Editor)?

If it still does not work
Try running your script from the systemwide Script Menu:

  • open AppleScript Editor
  • open its preferences > General
  • click checkbox “Show Script menu in menubar”

A black scroll icon will appear at the right end of the menu bar.
With Quark open & frontmost, go to that menu, and select “Open scripts folder > Open folder with Quark scripts”.
(the exact wording may differ, I’m running Dutch).
Put your script into that folder.
When you now go to the Scripts menu while in Quark, there will be a header “Quark scripts” and your script should show. Select & pray…

That did the trick. Thank you very much for your input. Cheers!!