Re: TIFF to PDF - easiest way?
Re: TIFF to PDF - easiest way?
- Subject: Re: TIFF to PDF - easiest way?
- From: KOENIG Yvan <email@hidden>
- Date: Mon, 27 Jun 2011 15:37:07 +0200
Le 27 juin 2011 à 15:11, Dmitry Markman a écrit :
>
> thanks it's very useful comment
>
> but I think you don't have to
> set w_names1 to name of windows
> you can use file_name for that
>
> also all menues, windows e.t.c. are enumerated
> so instead of name it is possible to use numbers
>
>
>
> On Jun 27, 2011, at 9:05 AM, KOENIG Yvan wrote:
>
>>
>> Le 27 juin 2011 à 14:45, Dmitry Markman a écrit :
>>
>>> tell application "Preview"
>>> open tiff_file
>>> activate
>>> tell application "System Events"
>>> tell process "Preview"
>>> click menu item "Print…" of menu 1 of menu bar item "File" of menu bar 1
>>> click menu button "PDF" of sheet 1 of window file_name
>>> click menu item 2 of menu 1 of menu button "PDF" of sheet 1 of window file_name
>>> click button "Save" of window "Save"
>>> end tell
>>> end tell
>>> end tell
>>
>>
>> For those which aren't running their system in English, I would code :
>>
>> tell application "Preview"
>> open tiff_file
>> activate
>> tell application "System Events"
>> tell process "Preview"
>> set w_names1 to name of windows
>> --click menu item "Print…" of menu 1 of menu bar item "File" of menu bar 1
>> keystroke "p" using {command down}
>> click menu button "PDF" of sheet 1 of window file_name
>> click menu item 2 of menu 1 of menu button "PDF" of sheet 1 of window file_name
>> repeat
>> if (count of windows) > (count of w_names1) then exit repeat
>> delay 0.1
>> end repeat
>> (*
>> set b_name to name of window 1
>> click button b_name of window b_name
>> *)
>> click button 4 of window 1
>> end tell
>> end tell
>> end tell
>>
It seems that you read too fast.
I get the names of every windows open before issuing the print command for the loop which wait until the availability of the Save window.
The window itself as well as the Save buttons are triggered by index :
>> click button 4 of window 1
Yvan KOENIG (VALLAURIS, France) lundi 27 juin 2011 15:36:50
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden