1 Reply Latest reply: Mar 27, 2013 2:34 PM by Kay Fisher
Kay Fisher Level 1 Level 1 (0 points)

No very little about apple script but I would like to drop a bunch of .pages files on a script and convert all the text to bold

 

This was my first attempt:

 

on open theFiles

          tell application "Pages"

                    repeat with aFile in theFiles

  open aFile

 

                              set bold to true

 

                              set docName to name of front document

  -- Remove .pages extension.

                              set prevTIDs to AppleScript's text item delimiters

                              set AppleScript's text item delimiters to ".pages"

  -- Add .pdf extension.

                              set docName to first text item of docName & ".pdf"

                              set AppleScript's text item delimiters to prevTIDs

  -- Get folder that dropped file exists in.

                              tell application "Finder"

                                        set sourceFolder to (container of aFile) as Unicode text

                              end tell -- Finder

  -- Save file to folder that dropped file exists in.

                              set docPathAndName to sourceFolder & docName

                              save front document as "SLDocumentTypePDF" in docPathAndName

  close front document

                    end repeat

          end tell

end open

 

Any help will be appreciated!

Kay Fisher