The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > Developer > AppleScripting Omni Apps
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Exportation in pdf with an applescript Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Hi,

I would like to create a bash script with an enclosed applescript. I need that because I have a NAS and I want to share pdf versions with people. I edit every days dozens of .oo3 so It would be more convenient to be able to include that process within my rsync script. I've try to do that but I don't know how to solve the issues :
Code:
set myDoc to "/Users/Pamphile/Desktop/notes.oo3"
set pdfSavePath to "/Users/Pamphile/Desktop/"

tell application "OmniOutliner Professional"
	activate
	open myDoc
end tell

tell application "System Events"
	tell process "OmniOutliner pro"
		-- Press command+p to open our print dialog
		keystroke "p" using command down
		
		-- Let's make sure our print dialog is up
		repeat until exists window "Print"
		end repeat
		
		-- Click the PDF menu button
		click menu button "PDF" of window "Print"
		
		-- Make sure the menu is up
		repeat until exists menu item "Save as PDF…" of menu 1 of menu button "PDF" of window "Print"
		end repeat
		-- Select the "Save as PDF" menu item
		click menu item "Save as PDF…" of menu 1 of menu button "PDF" of window "Print"
		
		-- Make sure the save dialog is visible
		repeat until exists window "Save"
		end repeat
		
		-- Press command+shift+g to show the "Go" drop down sheet
		keystroke "g" using {command down, shift down}
		-- Set our location field to our pdfSavePath
		set value of text field 1 of sheet of window "Save" to pdfSavePath
		-- Now click the Go button
		click button "Go" of sheet of window "Save"
		
		-- Now that we are in our desired folder, set the file name and save
		set value of text field 1 of window "Save" to "Notes.pdf"
		
		click button "Save" of window "Save"
	end tell
end tell
Thanks for your help !!!!

Last edited by pamplemousseman; 2011-08-29 at 01:28 PM..
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
XML and AppleScript seanprice OmniFocus Extras 0 2013-03-14 01:07 PM
Applescript help mojaverat OmniFocus 1 for Mac 1 2011-08-23 03:18 PM
Applescript? dbadev OmniDazzle 0 2011-06-22 05:46 PM
Applescript Help ryan_marsh OmniFocus 1 for Mac 3 2008-11-24 08:51 AM
Applescript, run from USB jem OmniFocus 1 for Mac 4 2007-05-22 02:09 AM


All times are GMT -8. The time now is 02:15 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.