Re: Using terms from syntax
Re: Using terms from syntax
- Subject: Re: Using terms from syntax
- From: David LeBer <email@hidden>
- Date: Fri, 23 Sep 2005 13:49:24 -0400
On 22-Sep-05, at 5:34 PM, has wrote:
David LeBer wrote:
I'm having problems getting my script to compile, for instance,
this compiles:
using terms from application "Macintosh HD:System Folder:Control
Panels:File Sharing"
This doesn't:
set startupDisk to path to startup disk as string
set filesharingPath to startupDisk & "System Folder:Control
Panels:File Sharing"
using terms from application filesharingPath
That's because 'using terms from' is a compiler directive - it's
used when source code is compiled, not when compiled code is executed.
Thanks, that explains a lot.
My utility sets a bunch of things up, configures some plists, etc,
one of the final things I need to do is set the Classic machine
name (for some legacy software) but because the Classic
environment has never been run when my utility launches I get
stopped by the Choose Application dialog looking for "File Sharing".
This has nothing to do with 'using terms from'; it's your 'tell
application "File Sharing"' block that's the problem. You need to
determine the target application dynamically, and wrap it in a
'using terms from' block that points to your local copy to get it
to compile. (It's a kludge.)
As Paul suggested:
-- or maybe better:
-- tell app "Finder" set filesharingPath to application file id
"shcp" as
Unicode text
using terms from application "File Sharing"
tell app filesharingPath
--your code here
end tell
end using terms from
This works perfectly.
My problems were just caused by wooly thinking on my part. Thanks all.
--
;david
--
David LeBer
"I am codeferous!"
Codeferous Software
site: http://www.codeferous.com
blog: http://david.codeferous.com
_______________________________________________
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