• 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: Controlling Pages within applescript?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Controlling Pages within applescript?


  • Subject: Re: Controlling Pages within applescript?
  • From: Yvan KOENIG via AppleScript-Users <email@hidden>
  • Date: Sat, 29 Feb 2020 21:10:18 +0100

You may try :

property asRtf : false
-- true will export as Rtf
-- false will export as text

set p2d to path to desktop as text
set aDoc to (p2d & "essai.pages") as «class furl»
tell application "Pages"
        set xy to open aDoc
        tell xy
                set itsName to its name
                if itsName ends with ".pages" then
                        set bareName to text 1 thru -7 of itsName
                else
                        set bareName to itsName
                end if
                set barePath to p2d & bareName
                if asRtf then
                        set destFile to (barePath & ".rtf") as «class furl»
                        export it to destFile as formatted text
                else
                        set destFile to (barePath & ".txt") as «class furl»
                        export it to destFile as unformatted text
                end if
        end tell
end tell

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) samedi 29
février 2020  21:10:06



 _______________________________________________
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

References: 
 >Controlling Pages within applescript? (From: "Richard.wilson--- via AppleScript-Users" <email@hidden>)

  • Prev by Date: Controlling Pages within applescript?
  • Previous by thread: Controlling Pages within applescript?
  • Index(es):
    • Date
    • Thread