Page 1 of 1
write layer script workflow
Posted: Sun Nov 07, 2021 11:22 am
by davoodice2
hi.
I want to test my layer script. but each time i have to create new layer and assign script. ctrl+shift+alt+L doesn't work. can any body give a better workflow?
Re: write layer script workflow
Posted: Sun Nov 07, 2021 12:10 pm
by hayasidist
I thought I had a script for this - but I can't find it right now -- but if you use
MohoLayer:SetLayerScript(path) you can remove and reload the file ..
[edit]oh forget it:
Stan has one:
https://mohoscripts.com/script/sz_refresh_layerscript
Re: write layer script workflow
Posted: Sun Nov 07, 2021 12:17 pm
by Lukas
Re: write layer script workflow
Posted: Sun Nov 07, 2021 1:10 pm
by davoodice2
thanks friends.
Re: write layer script workflow
Posted: Sun Nov 07, 2021 11:54 pm
by synthsin75
davoodice2 wrote: ↑Sun Nov 07, 2021 11:22 am
hi.
I want to test my layer script. but each time i have to create new layer and assign script. ctrl+shift+alt+L doesn't work. can any body give a better workflow?
You can actually unembed, hit apply, and reembed, but the scripts make it much faster. My own just reloads all the layerscripts, probably like Stan's.
Code: Select all
function Syn_ReloadLayerScripts:Run(moho)
local count = 0
repeat
local layer = moho.document:LayerByAbsoluteID(count)
if layer then
count = count + 1
local script = layer:LayerScript()
layer:SetLayerScript("")
layer:SetLayerScript(script)
end
until not layer
end
Re: write layer script workflow
Posted: Mon Nov 08, 2021 9:23 am
by davoodice2
synthsin75 wrote: ↑Sun Nov 07, 2021 11:54 pm
davoodice2 wrote: ↑Sun Nov 07, 2021 11:22 am
hi.
I want to test my layer script. but each time i have to create new layer and assign script. ctrl+shift+alt+L doesn't work. can any body give a better workflow?
You can actually unembed, hit apply, and reembed, but the scripts make it much faster. My own just reloads all the layerscripts, probably like Stan's.
Code: Select all
function Syn_ReloadLayerScripts:Run(moho)
local count = 0
repeat
local layer = moho.document:LayerByAbsoluteID(count)
if layer then
count = count + 1
local script = layer:LayerScript()
layer:SetLayerScript("")
layer:SetLayerScript(script)
end
until not layer
end
thanks