Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Example OS X applications written in JavaScript.

NotificationsYou must be signed in to change notification settings

tylergaw/js-osx-app-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Updates

06/15 - OS X 10.11 Release Notes

OS X 10.11 includes a number of updates to JSXhttps://developer.apple.com/library/prerelease/mac/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/Articles/OSX10-11.html#//apple_ref/doc/uid/TP40014508-CH110-SW1

Sandboxing info:https://developer.apple.com/library/prerelease/mac/qa/qa1888/_index.html#//apple_ref/doc/uid/DTS40015156

09/02/14 - YOSEMITE DEVELOPER PREVIEW 7 NOTE:

Developer preview 7 has fixed the major issues that were in dev preview 5. All ofthe demos are working again.

I updated the Radar:http://openradar.appspot.com/radar?id=6472227281174528

08/14/14 - YOSEMITE DEVELOPER PREVIEW 5/6 NOTE:

A good number of the demos are crashing. Any demo that has a button that you can clickthat does something will crash. (HandleBtnClick, NSOpenPanel, etc.)

I have a question up on the Apple dev forums:https://devforums.apple.com/thread/240935?tstart=150

I've submitted a bug to Apple, and it's copied on Radar:http://openradar.appspot.com/radar?id=6472227281174528

What is this?

Starting with OS X 10.10, Yosemite you can use JavaScript to create native Cocoaapplications. I wrote abig ole post to help get you started.

This is a collection of examples showing how to create many of the common componentsused in OS X Applications. The goal is to help people learn how to build appsby showing clear, atomic examples.

These aren't exhaustive examples. Most of them are as basic as possible. The ideaisn't to show everything that can be done, it's to give a solid foundation to get you started.

Running

You can run any of the example apps by double clicking them.

If you are running the app while editing from Script Editor, there are two different ways.Script > Run (cmd + r) is the normal run. This can be good for quick debugging, butthe app will not act like the application and is usually not what you want. You'llwant Script > Run Application (cmd + opt + r).

Editing

To view and edit the code for each example you will need to use the Script Editorapplication. It is located in Applications > Utilities > Script Editor. From thereyou can either File > Open any of the example apps or drag the example app iconto the Script Editor in the dock.

How to create an app

Since using JavaScript to create apps is new there's not much documentation. We'vehad the ability to do all of this with AppleScript for years, but I haven't hadmuch luck finding thorough docs on that either.

Here's a couple of gotchas that had me scratching my head for some time.

To create a new application:

  • Open a new document in Script Editor cmd+n
  • Save the document cmd+s
  • When prompted with the Save dialog, name your app, set the file format to Application, andmake sure you check the Stay open after run handler option.

NOTE: If you do not check the Stay open... option on the save dialog there doesnot appear to be a way to update this later. (I hope I'm wrong, but haven't found a way to do it yet).If the option isn't checked pretty much nothing is going to work how you expect it.

Code Signing

Apps created this way can be code signed. Signing your app is helpful if you areplanning to distribute it to other people. Code Signing is a broad topic, for detailscheck outhttp://macosxautomation.com/mavericks/codesign/index.html

Reference

JavaScript for Automation Release Notes

Check out the WWDC presentation onJavaScript for AutomationYou'll need an Apple Developer Account.

About

Example OS X applications written in JavaScript.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp