Re: Using terms from syntax
Re: Using terms from syntax
- Subject: Re: Using terms from syntax
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 22 Sep 2005 14:39:27 -0700
- Thread-topic: Using terms from syntax
I confirm that AppleScript will not compile a 'using terms from' line that
has variables in it. It must be hard-coded.
Normally that wouldn't matter at all. The hard-coding is just for your own
machine to know which application to access: it inserts «raw codes» in,
which will be understood on the user's computer if that branch of the code
needs to be run. The Deployment version of your app contains encoded .scpt
files that do not need to be recompiled.
IF you were trying to target a Classic app that also had no OS X equivalent,
this might be pretty tricky, since in Tiger the OSX version is found by
default unless you provide the full path. But - AFAIK - there is no "File
Sharing" app except the classic one. So I don't see why you can't:
set startupDisk to path to startup disk as Unicode text
set filesharingPath to startupDisk & "System Folder:Control
Panels:File Sharing"
-- 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
I see no reason why that shouldn't work.
--
Paul Berkowitz
> From: David LeBer <email@hidden>
> Date: Thu, 22 Sep 2005 10:23:25 -0400
> To: AppleScript Users <email@hidden>
> Subject: Using terms from syntax
>
> Short version: Where can I find documentation on the correct syntax
> for 'using terms from'
>
> Little bit longer version:
>
> 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
>
> And neither does this:
>
> set startupDisk to path to startup disk as string
> set filesharingPath to startupDisk & "System Folder:Control
> Panels:File Sharing"
> set filesharing to application filesharingPath
> using terms from filesharing
>
> Excruciatingly long version:
>
> I am working on a AppleScript Studio System Setup utility for an IT
> group.
>
> They are using NetRestore to deploy a base system image and then
> loading additional stuff on top using Radmind. The upshot is that the
> Classic System Folder is not loaded as part of the base system image.
>
> 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".
>
> So I'd like to use 'using terms from' to explicitly specify it's
> location. But I need to have it dynamic, I don't know the name of the
> startup disk until run time.
>
> Can anyone offer me a solution?
>
> --
> ;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
>
_______________________________________________
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