• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: saving AW file as PDF
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: saving AW file as PDF


  • Subject: Re: saving AW file as PDF
  • From: Gerd Wilmer <email@hidden>
  • Date: Thu, 24 Jul 2003 11:02:37 +1000

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>
_______________________________________________
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.

References: 
 >Re: saving AW file as PDF (From: Kok Ooi Kong <email@hidden>)

  • Prev by Date: Re: Scripting changes to InDesign Master Pages
  • Next by Date: Re: Why is AS so poorly documented?
  • Previous by thread: Re: saving AW file as PDF
  • Next by thread: Re: saving AW file as PDF
  • Index(es):
    • Date
    • Thread