Re: Forcing 'tell app' to use carbon, rather than classic app
Re: Forcing 'tell app' to use carbon, rather than classic app
- Subject: Re: Forcing 'tell app' to use carbon, rather than classic app
- From: David Cramer <email@hidden>
- Date: Sun, 12 Jan 2003 02:05:19 -0600
This is wonderful information! Now I finally think I understand how
the 'info as result' syntax works.
When I shortened the 'choose file...' script example you included to just...
choose file
info for result
...I could then see all of the data for any file I selected, and also
see how to refer to it in the future, for example, 'modification date
as text' and so on.
I am in your debt, Philippe.
Hi David!
tell application "Finder" to application file id "CHIM" as text
info for result
Thanks, Philippe. It works great!
Glad to help you ;)
By the way, here's the code I was talking about. It's from a script
associated with AWPSCalendarMaker by H Sanderson under the GNU
general public license, after I changed the code to work with
Chimera:
--****************************
--this script handles the processFile(fileAlias) message sent by
AWPSCalendarMaker applet, allowing users to post-process or handle
the generated calendar file as required
on processFile(fileAlias)
-- attempt to open html file in Explorer
try
tell application "Finder"
set theBrowser to application file id "CHIM"
-- (Chimera)
open fileAlias using theBrowser
end tell
on error
beep
end try
end processFile
--****************************
Great!
You can also just write a one line tell block (no break):
on processFile(fileAlias)
try
tell application "Finder" to open fileAlias using application
file id "CHIM"
on error
beep
end try
end processFile
Now my question is, how do you find out the file id of a package?
That's right, all packages have not a 'file creator' code, such Sherlock 3.
Below, a little request to a target app, but just handled like a
simple file: 'choose file', and not 'choose application'.
--=========================================================
choose file --> choose your app
(info for result)'s file creator --> the code is displayed in the
SE's Result window
-- set the clipboard to result --> optional: the code is put (paste)
into the clipboard
--=========================================================
Once you've got all your 'file creator' codes, no need to put this
'choose file' statement in every script.
Just use: application file id "----"
If you need to use more than one in a script, set a list:
set fcCode to {"CHIM", "MSIE", "sfri"}
tell application "Finder" to open fileAlias using application file
id (fcCode's item 1 as string)
HTH
Kind regards,
Philippe Gruchet/SVM Mac
VNU Publications France
http://svmmac.vnunet.fr
--
Regards,
David Cramer
*//////////////////\\\\\\\\\\\\\\\\\\\*//////////////////\\\\\\\\\\\\\\\\\\\*
* DOCUMENTS AND MORE * Winnipeg, Manitoba, Canada *
* "Intelligent digital design, * Tel: (204) 772-9284 *
* layout & publishing solutions" * Fax: (204) 774-5884 *
*//////////////////\\\\\\\\\\\\\\\\\\\*//////////////////\\\\\\\\\\\\\\\\\\\*
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.