Re: saving AW file as PDF
Re: saving AW file as PDF
- Subject: Re: saving AW file as PDF
- From: Kok Ooi Kong <email@hidden>
- Date: Thu, 24 Jul 2003 17:35:47 +0800
I am glad that it works but please note that its performance is not
always consistent, as in other new technology. Many expert AS scripters
seems to be looking down on GUI scripting. So Hall of Fame will not
have anyone who is doing this ;) Anyway, I have PreFab UI Browser, much
better than Apple UI Element Inspector in identifying the UI elements.
So, I am not genius, PreFab did the trick.
With regards to line 6, please note that it is only for folder and not
multiple files. You should have all the files in a folder before you
drag the folder (not the files) containing the files to be drop onto
the application. (-2 works only if it is folders and -1 works in
folders and files)
However, as I have said this is originally not by me, I can't account
for line 6. In fact I will use this:
tell application "Finder"
activate
display dialog "Selected folder must contain only Appleworks
Documents!" buttons {"*"} default button 1
set wndw to choose folder
set filez to count every file of folder wndw
end tell
There will be no issue about the file name and choose folder make sure
the item is a folder and not files. Also, you don't have to close
window at the end.
Cheers.
Kok Ooi
On Thursday, Jul 24, 2003, at 09:02 Asia/Kuala_Lumpur, Gerd Wilmer
wrote:
>
Kok Ooi you are a genius and should be installed in the AppleScript
>
Hall of Fame!!!
>
>
I have messed around with this for two weeks and you found the
>
solution.
>
Two small caveats:
>
line 6 of your code: set foldr to (characters 1 thru -2 of foldar) as
>
text
>
should be - 1 only otherwise it
>
cannot find the folder
>
>
and
>
>
for some reason, the last document converted physically prints and
>
does not get converted.
>
- Probably an undocumented feature of AppleScript.
>
>
Thanks again and post this on AppleScript BBS
>
>
>
Gerd Wilmer
>
>
>
On Tuesday, Jul 22, 2003, at 17:40 Australia/Sydney, Kok Ooi Kong
>
wrote:
>
>
> Hi,
>
> Sorry, tested the scripts and found it doesn't work anymore.Found a
>
> work around for the AppleWork part. Maybe there is some changes after
>
> upgrading throught os x, the original script is not working any more.
>
> Below is the script:
>
> Also, You need to enable access to assistive devices first. Go to
>
> System Preferences -> Universal Access and tick the Enable access to
>
> assistive devices, in order to use GUI scripting. Make sure that
>
> System Event is in Login Items. Then log out and log in again - to
>
> make sure it is activated.
>
> Purchase Prefab UI browser helps.
>
>
>
> on open
>
> tell application "Finder"
>
> activate
>
> display dialog "Selected folder must contain only Appleworks
>
> Documents!"
>
> set foldar to selection as text
>
> set foldr to (characters 1 thru -2 of foldar) as text
>
> open folder foldr
>
> set wndw to front window
>
> set filez to count every file of wndw
>
> end tell
>
> set counter to 0
>
> repeat while counter is less than filez
>
> set counter to counter + 1
>
> tell application "AppleWorks 6"
>
> activate
>
> open file counter of wndw
>
> end tell
>
> tell application "System Events"
>
> tell process "AppleWorks 6"
>
> set frontmost to true
>
> keystroke "p" with command down
>
> delay 1
>
> tell application "System Events"
>
> if title of window 1 of process "appleworks 6" is not "Print"
>
> then
>
> set frontmost of process "appleworks 6" to true
>
> keystroke return
>
> end if
>
> end tell
>
> tell window "Print"
>
> tell pop up button 1
>
> click
>
> tell menu 1
>
> click menu item "Output Options"
>
> delay 1
>
> end tell
>
> end tell
>
> click check box "Save as File" of UI element 1 of UI element 5
>
> delay 1
>
> click button "Save..." of UI element 6
>
> delay 1
>
> end tell
>
> tell window "Save to File"
>
> tell pop up button 1
>
> click
>
> tell menu 1
>
> click menu item "Desktop"
>
> delay 1
>
> end tell
>
> end tell
>
>
>
> click button "Save"
>
> delay 1
>
> end tell
>
> end tell
>
> end tell
>
> tell application "AppleWorks 6" to close front document
>
> end repeat
>
> tell application "Finder"
>
> activate
>
> close wndw
>
> display dialog "Conversion complete!"
>
> end tell
>
> end open
>
>
>
> mOn Tuesday, Jul 22, 2003, at 14:43 Asia/Kuala_Lumpur, Gerd Wilmer
>
> wrote:
>
>
>
>> You mean in OS X?
>
>>
>
>>
>
>> On Tuesday, Jul 22, 2003, at 16:40 Australia/Sydney, Kok Ooi Kong
>
>> wrote:
>
>>
>
>>> -----BEGIN PGP SIGNED MESSAGE-----
>
>>> Hash: SHA1
>
>>>
>
>>> I have been using both scripts without problem. Files are saved in
>
>>> pdf format. Sorry, can't help you then.
>
>>>
>
>>> On Tuesday, Jul 22, 2003, at 08:33 Asia/Kuala_Lumpur, Gerd Wilmer
>
>>> wrote:
>
>>
>
> <PGP.sig>
[demime 0.98b removed an attachment of type application/pgp-signature which had a name of PGP.sig]
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.