How logic master volume control by Applescript? - applescript

I Create one application via Applescript, and desktop to run this application,
I will automatically open the project file for a particular logic. After moving to the first track, but is the syntax to play.
I've created so far. Problem, but next to it.
When i make another application program via the Applescript,
It is got to try to fade out the Master Volume of the currently running logic,
but I tries to fade out,I do not know way.
How logic master volume control by Applescript?
Thanks!

I may be wrong, but I don't believe Logic has support for AppleScript. Its a shame too, there are many cool things that a scripting engine would open up.

Related

Keep Chrome Shortcut running in Windows Background

I' building a webapp that reads the database based on time to check changes. When there is a change, a notification in windows displays so the user is notified.
Chrome-> Dots menu-> More settings-> Create shortcut (as window) (Roghly Translated)
The problem is that the user needs to have the webapp opened so it is working and doing the before mentioned task. I thought a solution could be to run the shorcut on startup as a service or something (maybe in the icons next to the taskbar clock). But I don't know if this is the best approach or how to do that.
That's why I'm asking for help to find the best approach and if it is the one I'm thinking, to know how could I do that.

AppleScript — listen for mouse click?

I'm brand new to Apple Script and trying to write a simple script that, while running, logs a timestamp any time the mouse is clicked anywhere.
How can I detect/listen for mouse events, and execute a command (logging a date-time) when they happen?
(This seems to me like a pretty basic thing to try to do, but I may be misunderstanding what AppleScript is for.)
Mouse-clicks are events handled and distributed by the system. In order to capture them you'd need to set up an event monitor, but there are no hooks for that in vanilla AppleScript; the language isn't designed for it.
If you wanted to switch to AppleScriptObjC and create an application, you could certainly set up an event monitor of this sort (using something like NSEvent's addGlobalMonitorForEventsMatchingMask:handler:. But I doubt AppleScript is the best language for it. At least, I can't think of a compelling reason to do this in AppleScript as opposed to writing a small cocoa app, and I anticipate a number of headaches trying to make the callback work correctly.

How can one view the applescript code that executes on particular application?

There is one application that controls Microsoft Word 2011 for Mac using AppleScript.
It does really nice things that I want to implement in my own app.
So, is it possible to intercept AppleScript calls to particular application, and reconstruct source code of AppleScript that made that calls?
It is impossible to view source code of applescript that executes on particular app.
But debugging apple events, can make sense to cast a light on what is going on.
So I just opened Terminal.app and executed a command:
env AEDebugReceives=1 /Applications/Microsoft\ Office\ 2011/Microsoft\ Word.app/Contents/MacOS/Microsoft\ Word
That will force Microsoft Word (in fact almost any application) to print all received apple events in terminal.

How do I receive notification of a new window opening?

I want to respond to a certain type of new window being opened by an external application. I have some experience finding applications and windows currently open (system wide) using some of the carbon functionality, so could theoretically just check every few seconds. This would require getting a list of all open windows and checking it against some list I would have to maintain, and feels very clunky.
How can I get a simple, clean notification when a new window is launched? Should I use the accessibility API? If so, what specifically am I looking for?
First, create an AXObserver. Then, watch for launches of any applications that you think you'd be interested in. When such a launch occurs, create an application AXUIElement for that process, and add your observer to it for the kAXWindowCreatedNotification notification.
I question whether this is the best way to do whatever you're trying to do. You might step back a bit from this solution (that is, watching for new windows) and ask another question about your goal.

How can I post a Cocoa "sheet" on another program's window?

Using the Apple OS X Cocoa framework, how can I post a sheet (slide-down modal dialog) on the window of another process?
Edit: Clarified a bit:
My application is a Finder extension to do Subversion version control (http://scplugin.tigris.org/). Part of my application is a plug-in (a Contextual Menu Item for Finder); the bulk of my application, however, is in a separate daemon proces. For several reasons, we've chosen to put virtually all the code into the daemon; the plug-in only defines the menu itself, and Apple-Events over to the Daemon.
Sometimes, the daemon needs to prompt the user for further information. It can toss a window on-screen for this, but that's disruptive (randomly positioned), and it seems to me the work flow here is legitimately modal, for example "select a file, pick 'commit' from the menu, provide commit comments, do the operation."
Interprocess cooperation (such as passing a reference of some kind) is acceptable: both processes are mine, but I want to avoid binding the sheet's code into the primary process.
Really, it sounds like you're trying to have your inter-process communication happen at the view level, which isn't really how Cocoa generally works. Things will be much easier if you separate your layers a bit more than that.
Why don't you want to put the sheet code into the other process? It's view code, and view code is inherently process-specific. The right thing to do here is probably to add somewhat generic modal-sheet support to your plugin code, and an IPC call that your daemon can make to summon that code. Trying to ship view objects over to the remote process is going to be nightmarish if you can make it work at all.
You're fighting the frameworks with this approach.
You can't add a sheet to a window in another process, because you have at most only the most restricted access to the windows in the other process.
Please don't do this. Make the interaction nonmodal if at all possible. Especially in something like a commit, it's much nicer to be able to browse around your files while you're writing commit comments.
OS X does have window groups, but I don't think they can (easily) span applications.
Another thing to consider is that in OS X it's possible to have many Finder windows open on the same folder (unlike in OS 9). Even if you did have sufficient privileges/APIs to add a sheet to a Finder window, it's not like the modality of that window would prevent the user from being able to continue working with the files.
(My personal opinion as a long-time Mac user is that this kind of interaction would drive me right up the wall.)

Resources