exporting via applescript

Andrew Payne droo at odometer.org
Thu Feb 5 16:38:23 PST 2004


hey mike,

thanks for the background on the 00 script data fork bug. i use apple's 
script editor v2.0 on panther 10.3.2 on a 2ghz g5. yeah so i just took 
one of omni's sample scripts, copied it in the finder, changed it's 
name, overwrote it in the script editor, and saved it and it worked 
fine. so if you've got a script that works or a sample script form 00 
you can copy it in the finder and use that and it will work...at least 
it does for me. i think the key difference from my experience and 
curtis' is that i didn't do a save as, i think that's were it wreaks 
havoc on an otherwise okay script.

-ap

On Feb 5, 2004, at 4:11 PM, Michael Terry wrote:

>
> On Feb 5, 2004, at 4:02 PM, Andrew Payne wrote:
>
>> omni was driving me nuts after i altered the code you gave me and 
>> popped it in the script menu, then in the toolbar, it wouldn't 
>> work....AT ALL. nothing would happen. worked fine as an .app or from 
>> the script editor, but in omni it was dead. nothing! i was going 
>> crazy. so then i popped in some sample scripts from omni and they 
>> worked. copied that code over my script, mine still was dead. then 
>> copied mine over theirs, and it worked!?!?!? so i dupped their file, 
>> overwrote it, and changed the name, now it works fine. i checked the 
>> permissions and all is the same. so who knows.
>>
>
> What Script Editor do you use? Sounds like you were bitten by the OO 
> bug where scripts saved in the data fork don't work in OO's script 
> menu. Script Editor 2 saves to the data fork, so that doesn't work. 
> The only thing I don't quite understand about your story is that you 
> say you copied your code into one of Omni's script "shells" and saved 
> it and it worked. That means that whatever editor you're using 
> respects the format of the script you're editing. I don't remember 
> that being the case with SE 2 and Smile only saves to the resource 
> fork; are you using Script Debugger?
>
> There was a actually a good thread on this on-list just a couple weeks 
> ago. Let me dig it out here:
>
>> On Jan 17, 2004, at 9:25 PM, Curtis Clifton wrote:
>>
>>> Hi!  I'm working on some OO scripting for the first time since 
>>> installing Panther.  I had some difficulty to get the new scripts to 
>>> work from OO's Script menu.  I think it is because Script Editor 
>>> under Panther saves scripts to the data fork, while previously 
>>> scripts were saved in the resource fork.
>>>
>>> I had an old script, call it Script One, that just displays a simple 
>>> dialog box (contents of script attached).  Script One runs fine from 
>>> the OO Script menu.
>>>
>>> I did a Save As.. from Script Editor and made a duplicate of the 
>>> script with a new name, call it Script Two.  Script Two does not 
>>> work from the OO Script menu.
>>>
>>> I copied an old script using the Finder and named the copy Script 
>>> Three.  I opened Script Three in Script Editor and changed the 
>>> content.  Then I saved.  Script Three runs fine from the OO Script 
>>> menu.
>>>
>>> Using the command 'ls -l' in Terminal, I discovered that Script One 
>>> and Script Three show a size of 0, because their contents are in the 
>>> resource fork.  But Script Two, created by Panther's Script Editor, 
>>> shows a non-zero size, because its contents are in the data fork.
>>>
>>> After a bit Googling, I discovered the command 'osacompile', a 
>>> command-ilne utility for compiling AppleScripts.  The utility is in 
>>> /usr/bin on Panther and, by default, outputs the compiled script in 
>>> the resource fork.  After compiling the troublesome script with 
>>> osacompile, it runs without a hitch from OO's script menu.
>>>
>>> In summary:
>>>
>>> - OO does not handling data-fork only scripts from its Script menu.
>>> - Panther's Script Editor creates data-fork only scripts by default.
>>> - Using osacompile from the Terminal is a work-around.
>>>
>>> -- Curt
>>
>>
>> That's a good idea. I'm surprised osacompile still saves to the 
>> resource fork. Another work-around is to save scripts using the free 
>> script editor from Satimage called Smile. OmniGroup is aware of this 
>> bug; surely it will be fixed in the next release.
>>
>>
>> Mike
>>
>
>
> Mike
>
>
>




More information about the OmniOutliner-Users mailing list