Re: A newbie's problems with Pages and Applescript
Re: A newbie's problems with Pages and Applescript
- Subject: Re: A newbie's problems with Pages and Applescript
- From: KOENIG Yvan <email@hidden>
- Date: Sun, 31 Oct 2010 10:21:03 +0100
Le 31 oct. 2010 à 05:49, Adam Morris a écrit : 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?
If I understand you correctly I think you want: set nihaortf to name of info of (choose file) open nihaortf using app "Pages" delay 1 Tell app "Pages" Tell document nihao Xuexi hao zhongwen! Sent from my iPad
I apologize but :
(1) I never used the word "name" (2) I never used the word "info" (3) Pages doesn't open a document by its name but my its pathname.
Why not start using exactly what I wrote ?
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
Running it you will see that it does what you asked for. When this check will be done, and only after that, it would be time to edit it.
set nihaortf to choose file of type {"com.apple.iwork.Pages.sffPages", "com.apple.iwork.Pages.Pages"}
tell application "Pages" set nbd to count documents open nihaortf repeat until count documents > nbd delay 0.5 end repeat set niaho to name of document 1 tell document nihao -- your code end tell -- document end tell -- Pages
If you don't know the command choose file, it would be a good idea to look at its description in StandardAddition dictionary.
Yvan KOENIG (VALLAURIS, France) dimanche 31 octobre 2010 10:20:42
|
_______________________________________________
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