Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: osax
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: osax



I forgot one crucial coercion 'as alias' to go here:

set millisecOsax to POSIX file millisecOsaxPath as alias

Otherwise the Finder can't handle it. So ;


--creates the osax folders if they don't exist
set localOsaxFolderPath to (path to scripting additions from local
domain as Unicode text)
set userOsaxFolderPath to (path to scripting additions from user domain
as Unicode text)

try -- don't install it in user folder if already in local folder
get alias (localOsaxFolderPath & "GetMilliSec.osax")
on error
try -- don't install it if already there
get alias (userOsaxFolderPath & "GetMilliSec.osax")
on error
-- find it in your bundle
set millisecOsaxPath to path for "GetMilliSec" extension "osax"
--convert to colon-delimited path as an alias
set millisecOsax to POSIX file millisecOsaxPath as alias
tell application "Finder" to duplicate millisecOsax to folder
userOsaxFolderPath
end try
end try


--
Paul Berkowitz



> From: Paul Berkowitz <email@hidden>
> Date: Fri, 05 Sep 2003 08:36:55 -0700
> To: AppleScript Studio Mailing List <email@hidden>
> Subject: Re: osax
>
> On 9/5/03 3:59 AM, "Sascha Kuehn" <email@hidden> wrote:
>
>>
>> can i embed an osax in an project and use it without installing the
>> osax in the scripting additions folder?
>
> You can, but it won't do you any good there. it's dead simple to install it,
> however. This line:
>
> set osaxFolder to (path to scripting additions from user domain)
>
> or
>
> set osaxFolder to (path to scripting additions from local domain)
>
> creates the ScriptingAdditions folders in ~/Library and /Library
> respectively if it doesn't already exist.
>
> You can check to see whether the osax is already there, and if not copy it
> to there.
>
>
> --creates the osax folders if they don't exist
> set localOsaxFolderPath to (path to scripting additions from local
> domain as Unicode text)
> set userOsaxFolderPath to (path to scripting additions from user domain
> as Unicode text)
>
> try -- don't install it in user folder if already in local folder
> get alias (localOsaxFolderPath & "GetMilliSec.osax")
> on error
> try -- don't install it if already there
> get alias (userOsaxFolderPath & "GetMilliSec.osax")
> on error
> -- find it in your bundle
> set millisecOsaxPath to path for "GetMilliSec" extension "osax"
> --convert to colon-delimited path as a file
> set millisecOsax to POSIX file millisecOsaxPath
> tell application "Finder" to duplicate millisecOsax to folder
> userOsaxFolderPath
> end try
> end try
>
>
> --
> Paul Berkowitz
> _______________________________________________
> applescript-studio mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/applescript-studio
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-studio mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-studio
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: osax (From: Paul Berkowitz <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.