Search the web
Sign In
New User? Sign Up
jsosa · JavaScript OSA-Talk
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Messages 498 - 529 of 529   Newest  |  < Newer  |  Older >  |  Oldest
Messages: Show Message Summaries   (Group by Topic) Sort by Date v  
#529 From: selva kumar <templateteam@...>
Date: Fri Oct 12, 2007 11:38 am
Subject: Intro
templateteam
Offline Offline
Send Email Send Email
 
Hello All,

I am new to this group. I want to do programming in Mac thru Java to control applications.

Regards

Selva...........


Catch up on fall's hot new shows on Yahoo! TV. Watch previews, get listings, and more!

#528 From: "greenie64738" <greenie64738@...>
Date: Sun Sep 2, 2007 1:15 pm
Subject: Re: Vienna - possibility to delete, select or flag an article?
greenie64738
Offline Offline
Send Email Send Email
 
Hi,

and thanks for the reply. Though, meanwhile, I found the reason for the problems
myself.
The problem was that I am a newbie to Applescript and didn't realize that the
"r/o" in the
dictionaries mean "read only" and this is the case for the "flag"- as well as
other
properties. So there's no (obvious) way to flag an article, it might be possible
via GUI-
Scripting or sending raw Apple-events, but that's far too much hassle at the
moment for
what I wanted to try out. Just spent several hours to find out how to format an
Apple-
event for Apple-mail and that gave me headaches enough for one day :-)

Greetings,

Stephan

--- In jsosa@yahoogroups.com, Mark Alldritt <alldritt@...> wrote:
>
> Hi,
>
> > Hi all,
> >
> > I experimented with Vienna and jsosa and managed to get references to
folders
> > and articles
> > but I didn't find a way to flag, select or delete an article. I found
"flag"-
> > and "delete"-
> > properties and tried something like "article[articleindex].flag = true"
which
> > didn't work.To me
> > these properties seem to be just a way to ask for the current status of an
> > article. Or is there
> > something I miss?
> >
> > I don't know much about Applescript and next to nothing about AppleEvents,
but
> > from the
> > description I just read it sounds as if AppleEvents might be a way to
> > delete/flag/select
> > articles. Not sure about that though, so any help is highly appreciated.
> > Thanks.
>
> I'm not familiar with Vienna.  However, if you post the source of your
> script we may be able to offer suggestions.
>
> Cheers
> -Mark
>
> ------------------------------------------------------------------------
> Mark Alldritt                      Late Night Software Ltd.
> Phone: 250-380-1725                Script Debugger 4.0 - AppleScript IDE
> WEB:  http://www.latenightsw.com/  FaceSpan 4.3 - AppleScript RAD
>                                    Affrus 1.0 - Perl Debugging
>

#527 From: Mark Alldritt <alldritt@...>
Date: Tue Aug 28, 2007 4:17 pm
Subject: Re: Vienna - possibility to delete, select or flag an article?
malldritt2000
Offline Offline
Send Email Send Email
 
Hi,

> Hi all,
>
> I experimented with Vienna and jsosa and managed to get references to folders
> and articles
> but I didn't find a way to flag, select or delete an article. I found "flag"-
> and "delete"-
> properties and tried something like "article[articleindex].flag = true" which
> didn't work.To me
> these properties seem to be just a way to ask for the current status of an
> article. Or is there
> something I miss?
>
> I don't know much about Applescript and next to nothing about AppleEvents, but
> from the
> description I just read it sounds as if AppleEvents might be a way to
> delete/flag/select
> articles. Not sure about that though, so any help is highly appreciated.
> Thanks.

I'm not familiar with Vienna.  However, if you post the source of your
script we may be able to offer suggestions.

Cheers
-Mark

------------------------------------------------------------------------
Mark Alldritt                      Late Night Software Ltd.
Phone: 250-380-1725                Script Debugger 4.0 - AppleScript IDE
WEB:  http://www.latenightsw.com/  FaceSpan 4.3 - AppleScript RAD
                                    Affrus 1.0 - Perl Debugging

#526 From: "greenie64738" <greenie64738@...>
Date: Sat Aug 25, 2007 11:48 pm
Subject: Vienna - possibility to delete, select or flag an article?
greenie64738
Offline Offline
Send Email Send Email
 
Hi all,

I experimented with Vienna and jsosa and managed to get references to folders
and articles
but I didn't find a way to flag, select or delete an article. I found "flag"-
and "delete"-
properties and tried something like "article[articleindex].flag = true" which
didn't work.To me
these properties seem to be just a way to ask for the current status of an
article. Or is there
something I miss?

I don't know much about Applescript and next to nothing about AppleEvents, but
from the
description I just read it sounds as if AppleEvents might be a way to
delete/flag/select
articles. Not sure about that though, so any help is highly appreciated. Thanks.

#525 From: Mark Alldritt <alldritt@...>
Date: Wed Apr 18, 2007 6:39 pm
Subject: Re: The document "abc.app" could not be opened.
malldritt2000
Offline Offline
Send Email Send Email
 
Hi,

> While I'm not sure my problem is related to JSOSA, it is a JSOSA app
> that I'm trying to open to edit so I'll start here and hope something
> has some suggestions.
>
> I wrote an app using JSOSA. It has worked fine for years and years,
> upgrading it as JSOSA upgrades and Mac OS upgrades.
>
> I needed to edit it again today, but now I'm getting an error "The
> document "abc.app" could not be opened." when I try to open it in
> Script Editor 2.1.1.
>
> There are a few of these javascript based apps (older backup versions
> of my current version) that I can't open any more.
>
> I can open Script Editor, switch the language to javascript and run
> it. So JSOSA seems installed okay.  I've downloaded latest JSOSA. I
> downloaded latest Xcode thinking the Script Editor was corrupted
> somehow.
>
> So, I downloaded the current version of Script Debugger 4.0.5. This
> opened up abc.app. I copied the code, switched to Script Editor,
> pasted, set to javascript, saved it as an App (script, whatever does
> seem to matter), and when I try to open it again to edit it in Script
> Editor, I get the original error.

This is a Script Editor bug.  This entry on my Blog describes how to work
around the problem:

     http://www.latenightsw.com/blog/?p=10

Cheers
-Mark

------------------------------------------------------------------------
Mark Alldritt                      Late Night Software Ltd.
Phone: 250-380-1725                Script Debugger 4.0 - AppleScript IDE
WEB:  http://www.latenightsw.com/  FaceSpan 4.3 - AppleScript RAD
                                    Affrus 1.0 - Perl Debugging

#524 From: Hardy Machia <hardy@...>
Date: Wed Apr 18, 2007 5:55 pm
Subject: The document "abc.app" could not be opened.
hardymacia
Online Now Online Now
Send Email Send Email
 
While I'm not sure my problem is related to JSOSA, it is a JSOSA app
that I'm trying to open to edit so I'll start here and hope something
has some suggestions.

I wrote an app using JSOSA. It has worked fine for years and years,
upgrading it as JSOSA upgrades and Mac OS upgrades.

I needed to edit it again today, but now I'm getting an error "The
document "abc.app" could not be opened." when I try to open it in
Script Editor 2.1.1.

There are a few of these javascript based apps (older backup versions
of my current version) that I can't open any more.

I can open Script Editor, switch the language to javascript and run
it. So JSOSA seems installed okay.  I've downloaded latest JSOSA. I
downloaded latest Xcode thinking the Script Editor was corrupted
somehow.

So, I downloaded the current version of Script Debugger 4.0.5. This
opened up abc.app. I copied the code, switched to Script Editor,
pasted, set to javascript, saved it as an App (script, whatever does
seem to matter), and when I try to open it again to edit it in Script
Editor, I get the original error.

--
Hardy Machia     *    Catamount Software      *    Vermont Libertarian Party
802-372-9512     *    www.catamount.com       *    www.vtlp.org

#523 From: Mark Alldritt <alldritt@...>
Date: Sun Jan 7, 2007 3:59 am
Subject: JavaScript OSA vs Mac OS X 10.4 Script Editor
malldritt2000
Offline Offline
Send Email Send Email
 
Hi Folks,

Here's a tech note explaining how to get the 10.4 Script Editor to open
JavaScript OSA scripts:

    http://www.latenightsw.com/blog/?p=10

Cheers
-Mark

------------------------------------------------------------------------
Mark Alldritt                      Late Night Software Ltd.
Phone: 250-380-1725                Script Debugger 4.0 - AppleScript IDE
WEB:  http://www.latenightsw.com/  FaceSpan 4.3 - AppleScript RAD
                                    Affrus 1.0 - Perl Debugging

#522 From: Mark Alldritt <alldritt@...>
Date: Sun Jan 7, 2007 3:03 am
Subject: LNS Status Update
malldritt2000
Offline Offline
Send Email Send Email
 
Hi Folks,

I'm cross posting this message to all the LNS Mailing lists, so I apologize
if you see it more than once.

I've begun a blog to document my LNS related activities.  This will include
status updates on the progress of my various products, announcements of beta
builds, and other information.

     http://www.latenightsw.com/blog

The latest post is a summary of my plan for 2007, including some teaser
screen shots of FaceSpan 5 and Affrus 2:

     http://www.latenightsw.com/blog/?p=9

For 2007, I am going to do my beta testing a little differently.  In the
past, I have maintained a private list of testers who receive pre-release
builds.  Now I'm going to make my pre-release builds public through the
blog.

I also plan to post additional documentation, tech notes, etc. to the blog
as and when appropriate.

All of the mailing lists will remain and will continue to be the primary
forum for product support and announcements of product releases.

Cheers & Happy New Year
-Mark

------------------------------------------------------------------------
Mark Alldritt                      Late Night Software Ltd.
Phone: 250-380-1725                Script Debugger 4.0 - AppleScript IDE
WEB:  http://www.latenightsw.com/  FaceSpan 4.3 - AppleScript RAD
                                    Affrus 1.0 - Perl Debugging

#521 From: Mark Alldritt <alldritt@...>
Date: Fri Jan 5, 2007 6:23 pm
Subject: Re: Re: Console Output in Terminal?
malldritt2000
Offline Offline
Send Email Send Email
 
Hi,

> Being new to the mac world, I'm surprised that OSA (specifically
> javascript osa) hasn't had a HUGE impact. I'd much rather script to
> javascript than applescript.

That's probably a subject for an entire book.  The OSA (Open Scripting
Architecture) predates Windows Scripting Host and was a very good idea,
though in typical Apple style of the time, over engineered.

There was at one time an effort to make Windows and the Mac OS share the OSA
standard (see OpenDoc), but that broke down for lots of reasons and MS went
their own way with Windows Scripting Host.

In the Classic Mac OS days, the OSA runtime environment imposed memory
management restrictions that made it almost impossible to host Unix derived
scripting languages so JS, Perl, Ruby, Python where never ported.  These
restrictions have largely been removed under Mac OS X.  However, the total
lack of documentation and the complexity of creating an OSA version of any
scripting language has prevented many other languages from being implemented
- though there have been attempts.

As for why JSOSA didn't take off there are probably lots of reasons:

- AppleScript is good enough for most folks
- users must install JSOSA before they can run scripts while AppleScript is
bundled with the OS
- Apple's less than whole hearted support for OSA (e.g. Apple's Script
Editor gets a little unstable when using anything other than AppleScript,
AppleScript Studio is AppleScript centric when it could/should be OSA
centric)
- my support/promotion of JSOSA has not been successful
- my unwillingness to make JSOSA Open Source
- more attractive alternatives (AppleEvent hooks for Perl, Python and Ruby)

> Now, if there was only a Core.ConsoleOutput("") for running a script
> in terminal, rather than echo'ing... (hint hint) :)

I've filed a bug here, and I'll get it resolved in the next maintenance
release.

Cheers
-Mark

------------------------------------------------------------------------
Mark Alldritt                      Late Night Software Ltd.
Phone: 250-380-1725                Script Debugger 4.0 - AppleScript IDE
WEB:  http://www.latenightsw.com/  FaceSpan 4.3 - AppleScript RAD
                                    Affrus 1.0 - Perl Debugging

#520 From: "smakofsky" <smakofsky@...>
Date: Fri Jan 5, 2007 5:06 pm
Subject: Re: Console Output in Terminal?
smakofsky
Offline Offline
Send Email Send Email
 
Which is the *exact* reason I'd rather use JSOSA. Having apple event
support is killer.

Being new to the mac world, I'm surprised that OSA (specifically
javascript osa) hasn't had a HUGE impact. I'd much rather script to
javascript than applescript.

Now, if there was only a Core.ConsoleOutput("") for running a script
in terminal, rather than echo'ing... (hint hint) :)

--- In jsosa@yahoogroups.com, Mark Alldritt <alldritt@...> wrote:
>
> Hi,
>
> > I initally tried rhino before I found JSOSA - but it didnt appear
to
> > be able to interact with apple events. Do you know if it can?
>
> JavaScript OSA's ability to generate AppleEvents is its unique
feature.
> JavaScript OSA uses the Spider Monkey (Mozilla's C JavaScript
> implementation) and adds AppleEvent support.  The other change is
that it is
> hosted as an OSA language.
>
> Cheers
> -Mark
>
> --------------------------------------------------------------------
----
> Mark Alldritt                      Late Night Software Ltd.
> Phone: 250-380-1725                Script Debugger 4.0 -
AppleScript IDE
> WEB:  http://www.latenightsw.com/  FaceSpan 4.3 - AppleScript RAD
>                                    Affrus 1.0 - Perl Debugging
>

#519 From: Mark Alldritt <alldritt@...>
Date: Fri Jan 5, 2007 3:22 pm
Subject: Re: Re: Console Output in Terminal?
malldritt2000
Offline Offline
Send Email Send Email
 
Hi,

> I initally tried rhino before I found JSOSA - but it didnt appear to
> be able to interact with apple events. Do you know if it can?

JavaScript OSA's ability to generate AppleEvents is its unique feature.
JavaScript OSA uses the Spider Monkey (Mozilla's C JavaScript
implementation) and adds AppleEvent support.  The other change is that it is
hosted as an OSA language.

Cheers
-Mark

------------------------------------------------------------------------
Mark Alldritt                      Late Night Software Ltd.
Phone: 250-380-1725                Script Debugger 4.0 - AppleScript IDE
WEB:  http://www.latenightsw.com/  FaceSpan 4.3 - AppleScript RAD
                                    Affrus 1.0 - Perl Debugging

#518 From: "John \(Eljay\) Love-Jensen" <eljay@...>
Date: Fri Jan 5, 2007 3:14 pm
Subject: RE: Re: Console Output in Terminal?
eljay@...
Send Email Send Email
 
> I initally tried rhino before I found JSOSA - but it didnt appear to be able
to interact with apple events. Do you know if it can?

I do not know.  I presume it does not, given that it is Java based and runs in a
JVM.  (Not that running in a JVM makes it impossible to interact with AE.  But
it would require some effort to make it work.)

--Eljay

#517 From: "smakofsky" <smakofsky@...>
Date: Fri Jan 5, 2007 2:35 pm
Subject: Re: Console Output in Terminal?
smakofsky
Offline Offline
Send Email Send Email
 
I initally tried rhino before I found JSOSA - but it didnt appear to
be able to interact with apple events. Do you know if it can?

--- In jsosa@yahoogroups.com, John Love-Jensen <eljay@...> wrote:
>
> Hi Steve,
>
> Instead of JSOSA, you may want to consider using a Java based
JavaScript
> engine:
>
> For example...
>
http://weblogs.macromedia.com/mesh/archives/2003/12/shell_scripting.ht
ml
>
> (I hope my suggestion that isn't sacrilege on this forum.  :-)
>
> Sincerely,
> --Eljay
>
> JSOSA:
> http://www.latenightsw.com/freeware/JavaScriptOSA/index.html
>
> JSOSA 2.0 (alpha) - modernize JSOSA for OS X:
> http://www.latenightsw.com/freeware/JavaScriptOSA/jsosa2.html
>

#516 From: John Love-Jensen <eljay@...>
Date: Thu Jan 4, 2007 3:29 pm
Subject: Re: Console Output in Terminal?
eljay@...
Send Email Send Email
 
Hi Steve,

Instead of JSOSA, you may want to consider using a Java based JavaScript
engine:

For example...
http://weblogs.macromedia.com/mesh/archives/2003/12/shell_scripting.html

(I hope my suggestion that isn't sacrilege on this forum.  :-)

Sincerely,
--Eljay

JSOSA:
http://www.latenightsw.com/freeware/JavaScriptOSA/index.html

JSOSA 2.0 (alpha) - modernize JSOSA for OS X:
http://www.latenightsw.com/freeware/JavaScriptOSA/jsosa2.html

#515 From: "smakofsky" <smakofsky@...>
Date: Thu Jan 4, 2007 4:47 pm
Subject: Re: Console Output in Terminal?
smakofsky
Offline Offline
Send Email Send Email
 
Ah, ok..:

var Test = "Hello World";
MacOS.appSelf().do_shell_script("echo " + Test);

Seemed to do the trick. Would be nice to just have Core.Write() or
Core.Print(), but as you say - easy enough to add in via my own
function..


--- In jsosa@yahoogroups.com, Mark Alldritt <alldritt@...> wrote:
>
> Hi,
>
> > I'm running a script via terminal using:
> > osascript -lJavaScript filename.js
> >
> > but I can't seem to be able to output any text to the terminal.
> > Core.message is designed for popups (and doesnt work anyways),
print,
> > output, write, etc don't seem to work.
> >
> > Does anyone know any way to just output a line of text?
>
> The problem here is the osascript tool.  There is a 'log'
AppleEvent for
> this purpose, but osascript does not seem to respond to it.
>
> Testing from AppleScript, it does not seem to work:
>
> osascript -e 'log "testing"'
>
> If this were to work, you could generate the same event from JS.
>
> Now, if you only want to display one block of text, you can return
it as the
> value of the script:
>
> osascript -lJavaScript -e '"Testing"'
>
> The only alternative I can think of is dropping down to the shell:
>
> osascript -e 'do shell script "echo testing"'
>
> Which works.  So, in JSOSA this would look like:
>
> osascript -lJavaScript -e 'MacOS.appSelf().do_shell_script("echo
testing")'
>
> You can wrap this in a function and add it to the Core object and
then its
> available everywhere.
>
> Cheers
> -Mark
>
> --------------------------------------------------------------------
----
> Mark Alldritt                      Late Night Software Ltd.
> Phone: 250-380-1725                Script Debugger 4.0 -
AppleScript IDE
> WEB:  http://www.latenightsw.com/  FaceSpan 4.3 - AppleScript RAD
>                                    Affrus 1.0 - Perl Debugging
>

#514 From: Mark Alldritt <alldritt@...>
Date: Thu Jan 4, 2007 4:30 pm
Subject: Re: Console Output in Terminal?
malldritt2000
Offline Offline
Send Email Send Email
 
Hi,

> I'm running a script via terminal using:
> osascript -lJavaScript filename.js
>
> but I can't seem to be able to output any text to the terminal.
> Core.message is designed for popups (and doesnt work anyways), print,
> output, write, etc don't seem to work.
>
> Does anyone know any way to just output a line of text?

The problem here is the osascript tool.  There is a 'log' AppleEvent for
this purpose, but osascript does not seem to respond to it.

Testing from AppleScript, it does not seem to work:

osascript -e 'log "testing"'

If this were to work, you could generate the same event from JS.

Now, if you only want to display one block of text, you can return it as the
value of the script:

osascript -lJavaScript -e '"Testing"'

The only alternative I can think of is dropping down to the shell:

osascript -e 'do shell script "echo testing"'

Which works.  So, in JSOSA this would look like:

osascript -lJavaScript -e 'MacOS.appSelf().do_shell_script("echo testing")'

You can wrap this in a function and add it to the Core object and then its
available everywhere.

Cheers
-Mark

------------------------------------------------------------------------
Mark Alldritt                      Late Night Software Ltd.
Phone: 250-380-1725                Script Debugger 4.0 - AppleScript IDE
WEB:  http://www.latenightsw.com/  FaceSpan 4.3 - AppleScript RAD
                                    Affrus 1.0 - Perl Debugging

#513 From: "smakofsky" <smakofsky@...>
Date: Thu Jan 4, 2007 2:53 pm
Subject: Console Output in Terminal?
smakofsky
Offline Offline
Send Email Send Email
 
I'm running a script via terminal using:
osascript -lJavaScript filename.js

but I can't seem to be able to output any text to the terminal.
Core.message is designed for popups (and doesnt work anyways), print,
output, write, etc don't seem to work.

Does anyone know any way to just output a line of text?

Thanks,
-Steve

#512 From: Mark Alldritt <alldritt@...>
Date: Wed Nov 15, 2006 9:35 pm
Subject: ANNOUNCE: JavaScript OSA 2.0.1
malldritt2000
Offline Offline
Send Email Send Email
 
Hi Folks,

I've posted JavaScript 2.0.1 to the JavaScript OSA web site.  This version
has been available as part of Script Debugger 4 for some time.  You can now
download and install it independently from Script Debugger.

Download:

     http://www.latenightsw.com/freeware/jsosa/jsDownload.html

Release Notes:

     http://www.latenightsw.com/freeware/jsosa/jsStatus.html

Cheers
-Mark

------------------------------------------------------------------------
Mark Alldritt                      Late Night Software Ltd.
Phone: 250-380-1725                Script Debugger 4.0 - AppleScript IDE
WEB:  http://www.latenightsw.com/  FaceSpan 4.3 - AppleScript RAD
                                    Affrus 1.0 - Perl Debugging

#511 From: Mark Alldritt <alldritt@...>
Date: Thu Sep 21, 2006 11:05 pm
Subject: JavaScript 2.0 for Intel
malldritt2000
Offline Offline
Send Email Send Email
 
Hi Folks,

I got a email recently from a user asking if there is an Intel version of
javaScript OSA.  This made me realize that I had not released the final
JavaScript 2.0 build to the JSOSA web site.

If you want the final JSOSA 2.0 release (which is a Universal build), just
download and run Script Debugger 4.0.  I'll revise the web site soon.

Cheers
-Mark

------------------------------------------------------------------------
Mark Alldritt                      Late Night Software Ltd.
Phone: 250-380-1725                Script Debugger 4.0 - AppleScript IDE
WEB:  http://www.latenightsw.com/  FaceSpan 4.3 - AppleScript RAD
                                    Affrus 1.0 - Perl Debugging

#508 From: Arthur Knapp <admiralnovia@...>
Date: Sun Mar 26, 2006 6:32 pm
Subject: openssl
admiralnovia
Offline Offline
Send Email Send Email
 
I've thrown together a JSOSA port of an old AppleScript I wrote for
using the Unix "openssl" encryption and encoding command:

http://homepage.mac.com/admiralnovia/.cv/admiralnovia/Sites/.Public/
openssl-functions.js-binhex.hqx

-- Arthur

#507 From: Arthur Knapp <admiralnovia@...>
Date: Sat Mar 18, 2006 5:16 am
Subject: Preferences via defaults
admiralnovia
Offline Offline
Send Email Send Email
 
So there's this cool unix-shell thingy called "defaults" that
I've just become aware of. I've thrown together the following
object-wrapper as an example of using it:

Self = MacOS.appSelf();

	 // AppleScript's "quoted form of..."
	 //
String.prototype.toQuoted = function() {
	 return "'" + this.replace( /'/g, "\\'" ) + "'";
}

Prefs = {
	 plist : "My Amazing Preference Name", // don't include ".plist"
	 where : "~/Library/Preferences/", // note: don't quote "~/"
	 write : function( key, val ) {
		 Self.do_shell_script( "defaults write " + this.where +
			 this.plist.toQuoted() + " " +
			 String( key ).toQuoted() + " " +
			 String( val ).toQuoted()
		 );
	 },
	 read : function( key ) {
		 return Self.do_shell_script( "defaults read " + this.where +
				 this.plist.toQuoted() + " " +
				 String( key ).toQuoted()
			 );
	 }
}

Prefs.write( "favorite color", "plaid" );
Prefs.read ( "favorite color" ); //=> "plaid"


Goodnight,
-- Arthur

#506 From: Arthur Knapp <admiralnovia@...>
Date: Fri Mar 17, 2006 3:34 pm
Subject: Re: Feature Request.
admiralnovia
Offline Offline
Send Email Send Email
 
Mark Alldritt wrote:
>> A quick thought: How hard would it be to create special notation
>> for accessing the ._types and ._constants objects?
>Okay, I'll look into something like this.

Thanks Mark. I know (assume) that your freeware projects are not
at the top of your priorities, which is perfectly OK. The 2.0 version
of JSOSA is so wonderful, and I'm finally finding some time to do
some really good work in it.

> I've filed it all in my bug tracking system

Ohh...would this be one of those online systems that others can
see and contribute to?

Here is some more of my crazed rantings:

An issue I am struggling with now is working with
aeapp.sendAENoReply(), the principle problem being the
construction of AEPrint-strings and AEDescs. I'm working on a
seperate "report" for you on that issue, but the ideal would be
a system where we had a simple equivalent to "ignoring
application responses".

The three ways I see to go about this would be as follows:

1. AEApp instances could simply have a .noReply boolean
    property:

	 Finder = MacOS.finder();
	 Finder.noReply = true;

	 Finder.file[ "hello.txt" ].name = "HELLO.txt"

   Changing case is a good example of where we don't really
need to wait for a response, as it is a fairly safe operation.

2. Boolean parameter to the .appBy... methods, creating an
    instance that doesn't wait for replies:

	 Finder = MacOS.appBySignature( "MACS", true, false, true );
		 //
		 // 1st boolean : load dictionary
		 // 2nd boolean : _strict = false (while we're at it)
		 // 3rd boolean : no reply

3. Finally, I was thinking that perhaps an AEApp instance could
     have a property that would return a special noReply interface
     instance:

	 FinderNoReply = Finder.noReply();

   This would have the advantage of easily using it for "one off"
calls:

	 Finder = MacOS.finder();

	 // do lots of stuff with Finder, then

	 Finder.noReply().file[ "hello.txt" ] = "HELLO.txt";

or perhaps even the .noReply method could work something
like this:

	 Finder.noReply( "command_name", arg1, arg2, ... );

The only problem with this last idea is that there is no explicit
"set" (or "get") commands. Of course, there could be two
commands mapped to the get and set events:

	 var f = Finder.file[ "hello.txt" ];

	 f.getData( "name" ); // 'core' 'getd'
	 f.setData( "name", "HELLO.txt" ); // 'core' 'setd'

	 Finder.noReply( "setData", f, "name", "HELLO.txt" );

Er...OK, I'll leave you alone now. :)

-- Arthur

#505 From: Mark Alldritt <alldritt@...>
Date: Thu Mar 16, 2006 6:34 pm
Subject: Re: Feature Request.
malldritt2000
Offline Offline
Send Email Send Email
 
Hi,

> A quick thought: How hard would it be to create special notation
> for accessing the ._types and ._constants objects? I was thinking
> of a double underscore prefix for _types and the special "$"
> character (which Mozilla JavaScript allows) for _constants:
>
> with ( MacOS.finder() ) {
>
>       _display_dialog( "...", { with_icon : _constants.stop } );
>       _display_dialog( "...", { with_icon : $stop } );
>
>       _path_to( _constants.application_support, { 'from' :
> _constants.user_domain, 'as' : _types.alias } );
>       _path_to( $application_support, { 'from' : $user_domain, 'as' : __alias
> } );
>
>       make( _types.folder );
>       make( __folder );
> }

Okay, I'll look into something like this.  Thanks also for the proposed
code.  I've filed it all in my bug tracking system that that I can integrate
it when the time comes for the next JSOSA release.

Cheers
-Mark

------------------------------------------------------------------------
Mark Alldritt                      Late Night Software Ltd.
Phone: 250-380-1725                Script Debugger 4.0 - AppleScript IDE
WEB:  http://www.latenightsw.com/  FaceSpan 4.3 - AppleScript RAD
                                    Affrus 1.0 - Perl Debugging

#504 From: Arthur Knapp <admiralnovia@...>
Date: Wed Mar 15, 2006 6:25 pm
Subject: Feature Request.
admiralnovia
Offline Offline
Send Email Send Email
 
A quick thought: How hard would it be to create special notation
for accessing the ._types and ._constants objects? I was thinking
of a double underscore prefix for _types and the special "$"
character (which Mozilla JavaScript allows) for _constants:

with ( MacOS.finder() ) {

	 _display_dialog( "...", { with_icon : _constants.stop } );
	 _display_dialog( "...", { with_icon : $stop } );

	 _path_to( _constants.application_support, { 'from' : _constants.user_domain,
'as' : _types.alias } );
	 _path_to( $application_support, { 'from' : $user_domain, 'as' : __alias } );

	 make( _types.folder );
	 make( __folder );
}

-- Arthur

#503 From: Arthur Knapp <admiralnovia@...>
Date: Mon Mar 13, 2006 8:55 pm
Subject: Pashua and JSOSA
admiralnovia
Offline Offline
Send Email Send Email
 
I'm working on some example files of using JavaScript OSA
in combination with the Pashua GUI system. They're not
finished yet, but should be soon:

http://homepage.mac.com/admiralnovia/FileSharing1.html

They are in the Pashua folder.

-- Arthur

#502 From: Arthur Knapp <admiralnovia@...>
Date: Fri Mar 10, 2006 8:02 pm
Subject: Re: Re: Proposed Changes to the JavaScript Library
admiralnovia
Offline Offline
Send Email Send Email
 
>Whoops.

I've also placed a copy of the corrected script here:

     http://homepage.mac.com/admiralnovia/FileSharing1.html

-- Arthur

#501 From: Arthur Knapp <admiralnovia@...>
Date: Fri Mar 10, 2006 7:56 pm
Subject: Re: Proposed Changes to the JavaScript Library
admiralnovia
Offline Offline
Send Email Send Email
 
Whoops.

>MacOS.search = function( path ) {

[snip]

> if ( c == "." ) {
>  while ( path.slice( 0, 2 ) == "../" ) {
> 	 me = me.container;
> 	 path = path.slice( 3 );
>  }
>  return me;
> }

Replace the above with:

	 if ( c == "." ) {
		 while ( path.slice( 0, 3 ) == "../" ) {
			 me = me.container;
			 path = path.slice( 3 );
		 }
		 return new MacOS.FileSpec( me.path + "/" + path );
	 }


-- Arthur

#500 From: Arthur Knapp <admiralnovia@...>
Date: Fri Mar 10, 2006 7:03 pm
Subject: Proposed Changes to the JavaScript Library
admiralnovia
Offline Offline
Send Email Send Email
 
// Proposed changes and additions to the JavaScript Library file
// embedded in the JavaScript OSA component.


	 // I have yet to create a non-trivial jsosa project where I
	 // didn't neeed .appSelf(), especially for general purpose
	 // access the scripting additions, as well as generic access
	 // to calling .sendAE(). I always end up creating a global
	 // holding the "current application" because I'm worried
	 // about how expensive it is to repeatedly call the .appSelf
	 // method. This is especially problematic because most of my
	 // libraries also need an instance of the script-app itself.
	 //
	 // My only concern is with (in the future) loading Script
	 // Debugger's entire aete even though it would not nessesarily
	 // be needed. Would their be any way to create an instance of
	 // .appSelf() that would not load SD's dictionary but would
	 // still allow access to scripting addition terminology?
	 //
Self = MacOS.appSelf();
	 //
	 // P.S. I found this in your library file:
	 //
	 //  ... MacOS.appSelf( false, false ) ...
	 //
	 //      What does the second boolean parameter do? I can't
	 //      find documentation for it.



	 // Access to the global object is often needed for object/
	 // variable detection in the global namespace. In web
	 // browsers, one always has access to the "window" object,
	 // while in ActionScript, one always has access to "_root".
	 // JSOSA has no equivelant object, except via use of the
	 // contextual "this" keyword. Unfortunately, "this" is not
	 // always pointing at the global object, such as in a
	 // constructor function.
	 //
Global = this;



	 // The current MacOS.pathToMe() doesn't honor the Script
	 // Debugger preference setting for referring to the saved
	 // script file. This method does:
	 //
MacOS.pathToMe = function() {
	 var ae = new MacOS.AEDesc(); ae.build( "'null'()" );
	 // return MacOS.appSelf( false ).sendAE( 'ears', 'ffdr', ae );
	 return Self.sendAE( 'ears', 'ffdr', ae );
}

Core.me = MacOS.pathToMe().path;



	 // The current MacOS.findFolder() doesn't allow one to
	 // specify the "domain", as in "/Library" or
	 // "Users/USER/Library", etc. The .path_to event allows
	 // for this, along with the "folder creation" boolean.
	 //
MacOS.findFolder = function( fold, from, make ) {

	 var param = { 'ae_----' : fold };

	 if ( from ) param.ae_from = from;
	 if ( make ) param.ae_crfl = true;

	 // return MacOS.appSelf( false ).sendAE( 'ears', 'ffdr', param );
	 return Self.sendAE( 'ears', 'ffdr', param );
}



	 // I want to introduce the notion of "search paths" to OSA
	 // scripting. This would make dealing with libraries a
	 // thousand times easier. MacOS.search() tries to resolve
	 // and then locate a given posix|relative|special path
	 // string, returning a FileSpec instance.
	 //
	 // If the parameter starts with "/", then it is assumed to
	 // be a normal posix path:
	 //
	 //  MacOS.search( "/foo.bar" ); //=> new MacOS.FileSpec( "/foo.bar" )
	 //
	 // In addition, "tilde expansion" is performed:
	 //
	 //  MacOS.search( "~/foo.bar" ); //=> fspec "Users/USER/foo.bar"
	 //
	 // If the path starts with a "colon prefix", then a special
	 // "path to me" FileSpec is returned:
	 //
	 //  MacOS.search( ":foo.bar" ); //=> (applet)/Contents/foo.bar
	 //  MacOS.search( "::foo.bar" ); //=> (applet)/Contents/Resources/foo.bar
	 //  MacOS.search( ":s:foo.bar" ); //=>
(applet)/Contents/Resources/Scripts/foo.bar
	 //  MacOS.search( ":j:foo.bar" ); //=> (applet)/Contents/Resources/JavaScript
OSA/foo.bar
	 //
	 // Note: I'd like to introduce "JavaScript OSA" as a "standard"
	 // 	 folder name for those who wish to keep their AppleScript
	 // 	 and JSOSA files separated.
	 //
	 // If the path starts with one or more "../" prefixes, then it
	 // is assumed to be relative to the "path to me" applet, ie:
	 //
	 //  MacOS.search( "../foo.bar" ); //=> (applet's parent folder)/foo.bar
	 //
	 // foo.bar is in the same directory as the script application.
	 //
	 // OTHERWISE:
	 //
	 // .search() will attempt to find the file along the following
	 // search paths, (in this order):
	 //
	 //  (applet)/Contents/Resources/JavaScript OSA
	 //  (applet)/Contents/Resources/Scripts
	 //  (applet's parent folder)
	 //  /Users/USER/Library/JavaScript OSA
	 //  /Users/USER/Library/Scripts
	 //  /Library/JavaScript OSA
	 //  /Library/Scripts
	 //  /Users/USER/Library/Application Support/Script Debugger 4/JavaScript OSA
	 //  /Users/USER/Library/Application Support/Script Debugger 4/Script Libraries
	 //
	 // So for instance:
	 //
	 //  var myFile = MacOS.search( "files/math.js" );
	 //
	 // math.js will be systematically looked for in a "files"
	 // folder in all of the above locations.
	 //
	 // NOTE: For paths that start with a "/", "~", or ":", the
	 // 	 returned FileSpec may not exist, (allowing a scripter
	 // 	 to use .search() for paths to files that have not
	 // 	 yet been created). For a relative path that cannot
	 // 	 be found along the search paths, null is returned:
	 //
	 // 		 var myFile = MacOS.search( myPath );
	 // 		 if ( ! myFile || ! myFile.valid )
	 // 			 throw( "The file was not found!" );
	 //
	 // Whew...it took far longer for me to write the above comments
	 // than to write the code. ;-)
	 //
MacOS.search = function( path ) {

	 var c = path.charAt( 0 );

	      if ( c == "/" ) return new MacOS.FileSpec( path );
	 else if ( c == "~" ) return new MacOS.FileSpec( Core.home + path.slice( 1 ) );

	 var me = MacOS.pathToMe();

	 if ( c == ":" ) {
		 path = path.replace( ":j:", "/Contents/Resources/JavaScript OSA/" );
		 path = path.replace( ":s:", "/Contents/Resources/Scripts/" );
		 path = path.replace( "::",  "/Contents/Resources/" );
		 path = path.replace( ":",   "/Contents/" );

		 return new MacOS.FileSpec( me.path + path );
	 }

	 if ( c == "." ) {
		 while ( path.slice( 0, 2 ) == "../" ) {
			 me = me.container;
			 path = path.slice( 3 );
		 }
		 return me;
	 }

	 var fspec = new MacOS.FileSpec();

	 fspec.path = me.path + "/Contents/Resources/JavaScript OSA/" + path;
	 if ( fspec.valid ) return fspec;

	 fspec.path = me.path + "/Contents/Resources/Scripts/" + path;
	 if ( fspec.valid ) return fspec;

	 fspec.path = me.container.path + "/" + path;
	 if ( fspec.valid ) return fspec;

	 fspec.path = me.container.path + "/" + path;
	 if ( fspec.valid ) return fspec;

	 var currentDir = MacOS.findFolder( 'dlib', 'fldu' ); // /Users/USER/Library

		 fspec.path = currentDir.path + "/JavaScript OSA/" + path;
		 if ( fspec.valid ) return fspec;

		 fspec.path = currentDir.path + "/Scripts/" + path;
		 if ( fspec.valid ) return fspec;

	 currentDir = MacOS.findFolder( 'dlib', 'fldl' ); // /Library

		 fspec.path = currentDir.path + "/JavaScript OSA/" + path;
		 if ( fspec.valid ) return fspec;

		 fspec.path = currentDir.path + "/Scripts/" + path;
		 if ( fspec.valid ) return fspec;

	 currentDir = MacOS.findFolder( 'asup', 'fldu' ); // Application Support, user
domain
	 currentDir.path += "/Script Debugger 4";

		 fspec.path = currentDir.path + "/JavaScript OSA/" + path;
		 if ( fspec.valid ) return fspec;

		 fspec.path = currentDir.path + "/Script Libraries/" + path;
		 if ( fspec.valid ) return fspec;

	 return null;
}



	 // I wanted to name this .import(), but for no sane reason
	 // that appears to be a JavaScript reserved word.
	 //
	 // Script Debugger's Library feature does not work with
	 // JSOSA, and my problem with Core.load() is that it does
	 // not evaluate in the context of the global object; for
	 // example: I can't create a library that attaches methods
	 // to Array.prototype, because Core.load() seems to compile
	 // source code in it's own context.
	 //
	 // .include() passes it's parameter off to MacOS.search(),
	 // allowing for relative paths to be found in multiple
	 // locations.
	 //
Core.include = function( path ) {

	 var fspec = MacOS.search( path );

	 if ( ! fspec || ! fspec.valid )
		 throw( 'The path "' + path + '" cannot be located.' );

	 // this.eval( MacOS.appSelf( false ).read( fspec.alias ) );
	 Global.eval( Self.read( fspec.alias ) );
}

-- Arthur

#499 From: Arthur Knapp <admiralnovia@...>
Date: Sun Mar 5, 2006 3:55 pm
Subject: My JSOSA Clippings
admiralnovia
Offline Offline
Send Email Send Email
 
I've made an archive of a clippings folder, and put it
into my public iDisk thingy:

      http://homepage.mac.com/admiralnovia/FileSharing1.html

It is a work in progress. The "js-osa" clippings show every
object, method, and property of JavaScript OSA.

I'm working on updating my old AppleScript clippings to
use the new [[directives]], but my heart really isn't into
the task. :)

-- Arthur

#498 From: Arthur Knapp <admiralnovia@...>
Date: Tue Feb 28, 2006 9:32 pm
Subject: Quick Cheat Sheet
admiralnovia
Offline Offline
Send Email Send Email
 
I've been using a text file containing every jsosa object,
method, and property that I am aware of; as an "aid to
memory". It doesn't explain what things do, but it helps
to have such a listing to remind one of the available
aspects of the language. It has been updated to include
the changes made in version 2.0. Just thought someone
else might find this useful.

-- Arthur

Messages 498 - 529 of 529   Newest  |  < Newer  |  Older >  |  Oldest
Advanced
Add to My Yahoo!      XML What's This?

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help