Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old Jan 23, 2013, 12:14 PM   #1
southpaw1017
macrumors newbie
 
Join Date: Jan 2013
AppleScript HELP!

Before I begin, I'm completely new to AppleScript but I am very familiar with the Mac Interface.

I'm using the application QuarkXPress to export files in a bunch of different formats. To increase my productivity, I made shortcuts for each of the menu commands. Now, to make myself even more productive, I'd like to make a script that will run each menu command for me, in order.

Anyway, here's the horribly offensive code I've have so far:
Code:
tell application "QuarkXPress" to activate
tell application "System Events"
	click menu item "Usage..." of menu "Utilities" of menu bar item "Utilities" of menu bar 1 of application process "QuarkXPress"
	tell application "System Events"
		click menu item "Collect for Output..." of menu "File" of menu bar item "file" of menu bar 1 of application process "QuarkXPress"
		tell application "System Events"
			click menu item "Layout as PDF..." of menu "Export" of menu item "Export" of menu "File" of menu bar item "File" of menu bar 1 of application process "QuarkXPress"
			tell application "System Events"
				click menu item "Layouts as Project..." of menu "Export" of menu item "Export" of menu "File" of menu bar item "File" of menu bar 1 of application process "QuarkXPress"
			end tell
		end tell
	end tell
end tell
Assuming a lot of you don't use Quark regularly and cannot test this code out for yourself, I'll tell you what happens. I get the first window (Usage...) to open up, but when I'm done with that page, the next window (Collect for Output...) does not open, and the code stops running for all I know. Sometimes, when I run the code one of the other commands will run, but when I am done using that the code will stop. Is there something I can write that will not run the next command until I close the current window?

Since I'm assuming you guys can't use Quark, could you try and make an example using another application, like Safari?

Thank you, and sorry for my lack of knowledge!!
southpaw1017 is offline   0 Reply With Quote

 
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Why so much Applescript? Dranix Mac Programming 25 May 2, 2014 01:05 AM
help with applescript andrewisgod Mac Programming 0 Apr 18, 2014 07:58 AM
AppleScript: How do I save multiple Excel sheets to one pdf using Applescript sbtaylor1 Mac Programming 0 Oct 28, 2013 11:38 PM
AppleScript: How do I save multiple Excel sheets to one pdf using Applescript sbtaylor1 Mac Applications and Mac App Store 0 Oct 28, 2013 11:32 PM
Help with an Applescript Theydonboi Mac Applications and Mac App Store 2 Nov 5, 2012 11:52 AM

Forum Jump

All times are GMT -5. The time now is 01:51 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC