copying channel info

Use this forum for reporting bugs and requesting new features.
Post Reply
lanternz
Posts: 198
Joined: Mon Feb 04, 2008 10:59 am
Location: Adelaide

copying channel info

Post by lanternz »

I would like to be able to copy or swap info between fields. In MacLux we could swap channel info into circuit but I can not see how to do this in LxPro. Circuit to dimmer yes but not channel to circuit. Two reasons for this: to save channel info from an old version so that I have some way to compare old channel info to new channel info, and to patch a drawing where the channel numbers need to be compressed to fit a smaller system.
Lanternz
admin
Site Admin
Posts: 1643
Joined: Mon Nov 05, 2007 1:26 am
Contact:

Post by admin »

This kind of custom thing is why LXBeams supports scripting. It is actually easy to create an AppleScript to do what you want.

Go to the /Library/Application Support/lx/scripts/lxbeams folder. (hint: copy the preceding path and paste it into the Finder's "Go to Folder..." command)

In this folder you will see the two scripts, "copyCircuitToDimmer.scpt" and "copyDimmerToCircuit.scpt".

Click on "copyCircuitToDimmer.scpt" and choose "Duplicate" from the Finder's File menu. Rename the copy to "copyChannelToCircuit.scpt".

Double click the "copyChannelToCircuit.scpt file to launch the AppleScript editor.

Scroll down to the 5th line in the main "tell" that reads:
set the_circuit to current_light getInfo key "cir"

change that line to read:
set the_channel to current_light getInfo key "chan"

The next line reads:
tell current_light to setInfo key "dim" to the_circuit as string

change that line to read:
tell current_light to setInfo key "cir" to the_channel as string

Save the script. It should now appear in LXBeams' Scripts menu and you can use it.

You should probably move your new script into the scripts/lxbeams folder in your user library folder so it doesn't get overwritten by an upgrade install. But, that step in not absolutely necessary.
lanternz
Posts: 198
Joined: Mon Feb 04, 2008 10:59 am
Location: Adelaide

Post by lanternz »

thanks for that. works a treat. phpbb does not seem to flag new entries anymore - hence my delay.
Lanternz
Post Reply