• 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: A newbie's problems with Pages and Applescript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A newbie's problems with Pages and Applescript


  • Subject: Re: A newbie's problems with Pages and Applescript
  • From: "alma-services.abel.co.uk" <email@hidden>
  • Date: Tue, 2 Nov 2010 22:23:59 +0000

On 30 Oct 2010, at 21:43, KOENIG Yvan wrote:

So after a while I got intrigued by applescript. I messed around with it and came up with something that does the formatting of my study cards automatically, from a tab delimited RTF text file. My script is a bit flakey, and only fit for my own use right now. My problem is I don't know how to get the script to be user- friendly and open a file that the user chooses, from a dialogue. Instead, when the script runs, it assumes that the file is already open in Pages, and called "NiHao Raw.pages". Right now, everything falls over if it's not there when you click on run. What's the rick to getting a script to dialogue box and to choose and successfully open the (rtf) text document in Pages that's been selected?

...

set le_document to choose file of type {"com.apple.iwork.Pages.sffPages", "com.apple.iwork.Pages.Pages"}
tell application "Pages"
open le_document
end tell


may be what you need.


Dear Mr. Koenig,

Thank you for replying. Sorry for not getting back sooner: my moped stalled out and I have to bring it back to the house and clean the carburettor.

Anyway, I tried out your suggestion... the "Choose a File" dialogue opens, but unfortunately the "Choose" button is greyed out, and all items except folders are also greyed out. That's to say, .pages, .rtf and .txt files (and anything else I care to browse through!) are all greyed out. I am running on a PPC Mac OS X Leopard 10.5.8 with Pages '08 3.0.1. What am I doing wrong? (Maybe mercury is in retrograde!)

Regards,

Sandy
--
Alexander Anderson <email@hidden>
North Yorkshire, England

_______________________________________________
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
  • Prev by Date: Re: How Do I Get the html Source for a Web Page into a String?
  • Next by Date: TreeView X and dnd Files
  • Previous by thread: Re: How Do I Get the html Source for a Web Page into a String?
  • Next by thread: Re: A newbie's problems with Pages and Applescript
  • Index(es):
    • Date
    • Thread