• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using terms from syntax
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Re: Using terms from syntax (From: has <email@hidden>)

  • Prev by Date: Re: Problem with "unavailable" values...
  • Next by Date: Re: Using terms from syntax
  • Previous by thread: Re: Using terms from syntax
  • Next by thread: Re: Using terms from syntax
  • Index(es):
    • Date
    • Thread