In Lthe XConsoles settings one can decide what script to run on a cues update.
Would it be possible to have a simiar function in LXFree/Beams so that when I mark a symbol representing a channel nr it also triggesr a script that picks up the chosen channel nr, jumps to LxConsole and there marks that channel.
I could then use my plot instead of the main window or command line in LXconsole to mark and activate channels in LXConsole. That could be handy since I often end up behind two screens anyway.
I would still have to stay in LXConsole to fade channel x up or down, or at least Id have to leave the main window of LXconsole open and available on screen to be able to scroll over it.
-
In the graphical plot one can mark several symbols at once so a script that gathers info about marked channels would have to be able to handle a list of numbers.
My question is simply: - is it doable?
request: A script to run on action mark ch
-
- Posts: 294
- Joined: Mon Sep 01, 2008 12:35 pm
- Contact:
Try the following:
tell application "LXBeams"
tell the front document to setSomeLights key "selection" contains ""
set the_lights to every somelight of the front document
set the_count to the number of items in the_lights
set the_command to ""
set first_channel to true
repeat with i from 1 to the_count
set current_light to item i of the_lights
set the_channel to (channel of current_light) as integer
if the_channel > 0 then
if (first_channel is equal to true) then
set first_channel to false
set the_command to the_channel as string
else
set the_command to the_command & "&" & the_channel as string
end if
end if
end repeat
set the_command to the_command & "@select"
end tell
tell application "LXConsole"
if the front document exists then
activate
tell the front document to doCommand string the_command
end if
end tell
tell application "LXBeams"
tell the front document to setSomeLights key "selection" contains ""
set the_lights to every somelight of the front document
set the_count to the number of items in the_lights
set the_command to ""
set first_channel to true
repeat with i from 1 to the_count
set current_light to item i of the_lights
set the_channel to (channel of current_light) as integer
if the_channel > 0 then
if (first_channel is equal to true) then
set first_channel to false
set the_command to the_channel as string
else
set the_command to the_command & "&" & the_channel as string
end if
end if
end repeat
set the_command to the_command & "@select"
end tell
tell application "LXConsole"
if the front document exists then
activate
tell the front document to doCommand string the_command
end if
end tell
-
- Posts: 294
- Joined: Mon Sep 01, 2008 12:35 pm
- Contact:
Works like a charm
With that script working so perfectly I´ll have to modify my request some.
Would it be possible to assign certain favorite scripts a keyboard command or a button?
I'd prefer, at least in this case, the ability to use user specified keyboardcommands but for some other things maybe graphical buttons (invisible at prints) could be useful.
When I say a "button" I mean an outlined and filled textfield to which one can assign any of the scripts available.
Would it be possible to assign certain favorite scripts a keyboard command or a button?
I'd prefer, at least in this case, the ability to use user specified keyboardcommands but for some other things maybe graphical buttons (invisible at prints) could be useful.
When I say a "button" I mean an outlined and filled textfield to which one can assign any of the scripts available.
The latest build v2.1.0 (6316) has the ability to repeat the last script that you used via a menu item with a shortcut of Command /.
Unfortunately, the future of this kind of use of AppleScript is unclear. It is generally forbidden in a sandboxed application. At the moment neither LXFree or LXBeams are sandboxed. However, they will need to be to be distributed via the app store. That's no so big a deal because you will still be able to download and use them outside the app store. But, in order to use entitlements like iCloud, the above conditions appear to be required.
Apple is saying nothing but there is speculation that AppleScript will be dropped entirely in the future. No need to panic, Apple usually gives notice and a transition on things like that. However, tying too much new into AppleScript at the moment may not be wise. There may be some new, sandbox safe ways of communicating between applications coming as well.
Having said all that, an improved version of the above script is now included with LXBeams' latest build version.
Unfortunately, the future of this kind of use of AppleScript is unclear. It is generally forbidden in a sandboxed application. At the moment neither LXFree or LXBeams are sandboxed. However, they will need to be to be distributed via the app store. That's no so big a deal because you will still be able to download and use them outside the app store. But, in order to use entitlements like iCloud, the above conditions appear to be required.
Apple is saying nothing but there is speculation that AppleScript will be dropped entirely in the future. No need to panic, Apple usually gives notice and a transition on things like that. However, tying too much new into AppleScript at the moment may not be wise. There may be some new, sandbox safe ways of communicating between applications coming as well.
Having said all that, an improved version of the above script is now included with LXBeams' latest build version.
-
- Posts: 294
- Joined: Mon Sep 01, 2008 12:35 pm
- Contact:
Aha!
OK, we willl have to wait and see then...
Meanwhile Ill download the latest build.
-
If you like me did find the above answer in parts a bit difficult to understand, this wikipedia article helped me some.
http://en.wikipedia.org/wiki/Sandbox_%2 ... ecurity%29
Meanwhile Ill download the latest build.
-
If you like me did find the above answer in parts a bit difficult to understand, this wikipedia article helped me some.
http://en.wikipedia.org/wiki/Sandbox_%2 ... ecurity%29
-
- Posts: 294
- Joined: Mon Sep 01, 2008 12:35 pm
- Contact:
In the "control-console" heading the script is called "select Channels in LXConsole"
What is improved is that the script does not just make a list of every channel of every selected light. It makes a list of channels and checks for duplicates as it goes along. Although the LXConsole will accept a command of "1&1&2&2"@select, it is better to just say "1&2@select"
Functionally though, the script is the same.
----
Apple has several new technologies that improve security. All apps on an iPhone or iPad run in a sandbox where they are isolated from system resources. Thus, even if infected/exploited/programmed maliciously the app has limited or no ability to harm other parts of the computer.
The same sandbox idea is being extended to OS X. The unfortunate side effect is that because of this enforced isolation, sandboxed apps cannot communicate with each other either. To do so would put a hole in the sandbox and defeat its purpose. The probable solution is a way for applications to share their sandboxes. But that solution (and if it will include AppleScript) is what is unclear.
What is improved is that the script does not just make a list of every channel of every selected light. It makes a list of channels and checks for duplicates as it goes along. Although the LXConsole will accept a command of "1&1&2&2"@select, it is better to just say "1&2@select"
Functionally though, the script is the same.
----
Apple has several new technologies that improve security. All apps on an iPhone or iPad run in a sandbox where they are isolated from system resources. Thus, even if infected/exploited/programmed maliciously the app has limited or no ability to harm other parts of the computer.
The same sandbox idea is being extended to OS X. The unfortunate side effect is that because of this enforced isolation, sandboxed apps cannot communicate with each other either. To do so would put a hole in the sandbox and defeat its purpose. The probable solution is a way for applications to share their sandboxes. But that solution (and if it will include AppleScript) is what is unclear.