• 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: Store Script Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Store Script Problem


  • Subject: Re: Store Script Problem
  • From: Dave <email@hidden>
  • Date: Sun, 15 Nov 2015 19:17:03 +0000


On 15 Nov 2015, at 06:02, Shane Stanley <email@hidden> wrote:

On 15 Nov 2015, at 4:01 PM, Christopher Stone <email@hidden> wrote:

If you look at store script it requires a script object as its direct object.

A text script is NOT a script object.

Ah, I didn't even notice that -- good point.

But it's not going to make much difference, I don't think, because store script and ASObjC don't get along. Try adding use framework "Foundation" to the script you posted elsewhere, to see what I mean.

I suspect there is a method using ASObjC (but that'll have to wait for Shane).

In this case Dave is writing a hybrid Objective-C/AS app, so he might as well just do it in Objective-C or C. But it can be done like this:

use framework "Foundation"
use framework "OSAKit"

set sourceURL to current application's class "NSURL"'s fileURLWithPath:"path/to/file.applescript"
set destURL to current application's class "NSURL"'s fileURLWithPath:"path/to/file.scpt"
set theScript to current application's OSAScript's alloc()'s initWithContentsOfURL:sourceURL
set theResult to theScript's compileAndReturnError:(missing value)
if theResult as boolean then
theScript's writeToURL:destURL ofType:(current application's OSAStorageScriptType) |error|:(missing value)
end if


Where do I add this code? To OutlookHander.applescript or OutlookTestHarness.applescript?

Thanks a lot
Dave


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Store Script Problem (From: Dave <email@hidden>)
 >Re: Store Script Problem (From: Christopher Stone <email@hidden>)
 >Re: Store Script Problem (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Store Script Problem
  • Next by Date: Re: Store Script Problem
  • Previous by thread: Re: Store Script Problem
  • Next by thread: Re: AppleScript-Users Digest, Vol 12, Issue 551
  • Index(es):
    • Date
    • Thread