Re: Forcing 'open' to return a value in Cocoa apps
Re: Forcing 'open' to return a value in Cocoa apps
- Subject: Re: Forcing 'open' to return a value in Cocoa apps
- From: kai <email@hidden>
- Date: Sat, 11 Mar 2006 21:58:18 +0000
On 11 Mar 2006, at 14:54, Brennan wrote:
... I have just heard from one of the QuickTime engineers who
provided this much better workaround:
set myMov to choose file
tell application "QuickTime Player"
QuickTime Version -- e.g. app-specific terminology
set m to (open myMov)
return m
end tell
In other words, if you use a piece of terminology exclusive to that
app,
all the terminology gets forced to load in good time, and 'open'
then does
the right thing.
Just plain old 'version' should also work, Brennan:
---------
set myMov to choose file
tell application "QuickTime Player"
version
set m to (open myMov)
return m
end tell
---------
... as should:
---------
set myMov to choose file
tell application "QuickTime Player"
«event ascrgdte»
set m to (open myMov)
return m
end tell
---------
I am posting here in case anyone else has been frustrated by this
issue
with QuickTime Player or any other Cocoa apps. (-And also to ask if
anyone
can find a piece of TextEdit terminology which will take the place of
'QuickTime Version' and make us all happy until the hopefully-
inevitable
fix).
I don't think the same tricks will work with TextEdit (at least, not
to achieve the same end). For a workaround, you might try something
like:
---------
set myDoc to choose file
tell application "TextEdit"
open myDoc
tell (first document whose path is POSIX path of myDoc)
if not (exists) then error "Could not open document."
set d to it
end tell
(* do something with d *)
end tell
---------
(TextEdit evidently refers to documents by index, rather than by name.)
---
kai
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden