Yosemite comes with JavaScript

[quote=98089:@Sam Rowlands]Unless you know something that isn’t public, I wouldn’t be so confident. In the past Apple have dropped their own technologies for industry standards and it seems like with development, they’re trying to increase their numbers by making their own language more approachable.

What gives me doubt is the current state of Apple Scriptability with the App Sandbox. Apple is forcing people to move over to using ‘Scripting-Targets’ for scripting apps, yet most of their apps don’t have this functionality and the ones that do are only providing basic support.[/quote]

There’s simply no way Apple would drop AppleScript without years of advance notice. Without AppleScript, 90% of the publishing industry would come to a dead halt. Apple knows that.

I suppose one might have worried that Apple would let their scripting (i.e., OSA) support in general wither away. If anything, the new JavaScript announcement signals their strong commitment to OSA, and there is no evidence — as in, none — to suggest they are planning to drop AppleScript, or even to favor JavaScript over AppleScript. I don’t understand why anyone is even speculating about such a thing.

Apple usually leaves us with problems, in Applications of Carbon remember that in Lion just does not work anymore, my license of Photoshop CS 2 was to trash, not to mention the Quicktime, so do not think my concerns are exaggerated because my designs are based very AppleScripts.

The front end language use doesn’t really matter
Under the hood it all amounts to the same set of OSA commands being sent

[quote]Norman Palardy The front end language use doesn’t really matter
Under the hood it all amounts to the same set of OSA commands being sent[/quote]

yes but the problem is I do not know how to convert batches of my AppleScripts in Javascripts, or another language, so I am so worried.

DO NOTHING
There is NOTHING to worry about until / unless Apple says “we no longer ship the applescript language component”
Which they have not done

Quite literally you’re panicking about something that has not happened

OK, Tanks Norman Palardy.

If by ‘convert batches’ you mean converting automatically to JavaScript, I am not sure such a product exists or will exist. Any language has its own way and word for word translation seldom conduces to elegant code. Or working, for that matter. Scripting apps through AppleScript is sometimes more an art than a technique, which would require transposition to work.

In recent evolution, AppleScript has dropped the Click command, and that conduced me to create my own. In doing so, I realized that a lot can be done through simple clicks, even without AppleScript.

These days, I have been studying JavaScript more closely for Web applications and browsers bookmarklets. I intend to become familiar with the Apple automation implementation. At first glance, it seems fairly simple to approach. And click() is there. What I did not understand yet is how, in practice, work with it. As the page states it is still a preliminary document, we maybe still far from the actual implementation.

In essence, I would suggest that instead of panicking, you study the page at
https://developer.apple.com/library/prerelease/mac/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/index.html#/apple_ref/doc/uid/TP40014508

OK. I just experimented quickly with Yosemite Script Editor. Now it offers the choice between AppleScript and JavaScript. I was able to apply the example that opens a new document in Notes described at the page above by simple copy/paste. I had to set Script Editor as able to control the computer in the Security & Privacy/Accessibility Preferences, and that’s it.

Finally, to be fair, JavaScript for UI automation is not new to Mac OS X.
Here is a 2012 example for XCode 4 :
http://www.mikebobiney.com/2012/06/12/getting-started-with-ui-automation-in-xcode-4/

Michel Bujardet Thank you for your attention, I am grateful for that.

You are welcome.

You may want to experiment with the “getting started with UI automation” link I posted. From what I can see, it seems to be the same as what is implemented in 10.10.

Because it is in Xcode, Christian could probably conceive a plugin to add that to Xojo programs. Or it could be added to Xojo directly, maybe through an ExecuteJavaScript for desktop.

[quoteMichel Bujardet Because it is in Xcode, Christian could probably conceive a plugin to add that to Xojo programs. Or it could be added to Xojo directly, maybe through an ExecuteJavaScript for desktop.
[/quote]

yes, I had thought the executejavascript function, hopefully will be implemented in future versions of XOJO.

Again thank you.

yes, I had thought the executejavascript function, hopefully will be implemented in future versions of XOJO.

Thank you Again.

[quote=98222:@Paulo Vargas][quoteMichel Bujardet Because it is in Xcode, Christian could probably conceive a plugin to add that to Xojo programs. Or it could be added to Xojo directly, maybe through an ExecuteJavaScript for desktop.
[/quote]

yes, I had thought the executejavascript function, hopefully will be implemented in future versions of XOJO. [/quote]

I did not have time to experiment, but it seems fairly easy to create an XCode automation program that can be called from a shell. So even without anything, Javascript UI automation seems fairly easy to implement right now.

I would not rush replacing AppleScript though. Nothing indicates that JavaScript UI automation works in Snow Leopard, and as pointed out earlier, AppleScript is not deprecated.

The other thing I just thought, is what do your Apple Scripts do? I recently helped out a developer who was using Apple Script to send console commands to the Terminal! What made matters worse (IMHO) is all the commands he was sending, there are actual API functions, so he not only didn’t need to use Apple Script, but didm;t even need to use console applications.

API requires some declare knowledge. But writing a bash script is as simple as typing into the terminal. I cannot see why this guy would have needed AppleScript for that. Well… As anything program, there are several ways to get the same result :wink:

I use AppleScripts to communicate with Photoshop and Illustrator for example, one Applescript reads the name of the Layer of an open image and sends for a Listbox and do not know how to do this without AppleScripts.

Another Applescript I use to run Javascripts in the Adobe software package and this is also irreplaceable for me at the moment.

Before speaking there as I say I am self taught and I schedule a little time and so do not have this information, if anyone can help me I would appreciate any help even if Applescript is not depreciated.

So glad I don’t use Apple bullshit.

I’m sure Apple are devastated.

To speak honestly this kind of crap would be better not to say anything because it does not help in serious discussion that the group intends.

@Paulo: Oliver must use Windows then. Let’s pity him - just a bit.

I know this is straight-up trolling and comes from baseless generalizations, but let’s analyze it for a bit:

So, you’re glad you don’t use “Apple ■■■■■■■■” because, in this specific case, you would’ve been subjected to suffer an open architecture initially released 27 years ago being unfairly expanded to support the most widely-used and known scripting language in the world, 19-year-old JavaScript, all while unforgivably not requiring app developers to change a thing (OSA automation in apps is language independant) and without removing support for the previous language.

By this stage AppleScript has been with us through 12 Major OS versions, 27 years and three wildly different system architectures (Motorola 680x0, Motorola/IBM PowerPC and Intel x86). And it’s not being deprecated any time soon. The new language being supported from now on is massively popular and has almost two decades of proven history.

I have to say, I have a hard time seeing the point you find so obvious you didn’t feel the need to expand :slight_smile:

Our own Bruce Keeneywrote a similar thing commented on this in 2008. Daniel Jalkut of Red Sweater , actually calling for JavaScript to be made an equal citizen to AppleScript

@Paulo Vargas : AppleScript is not being deprecated in any way. There’s not even a hint of that. You have nothing to be concerned of at this stage. The soonest we can expect a “date” for when it would be is in one year and the actual date when it would effectively be so is at least four or five years into the future.

I don’t think it’d be a bad idea to learn JavaScript, since the language is useful for many other things but that would be simple preparation for the time when you have to decide whether you want to migrate your automations.

Remember that adopting JavaScript is ensuring a great feature (simple inter-app automation) is taken more advantage of by enabling programmers who’ve never seen or used AppleScript to be effective immediately. It’s not different than ObjectiveC in that purpose. The OS Inter-app automation has always been exciting in OS X but niche. This should expand that scope enormously.