CyanBlue
07-13-2007, 02:32 PM
Howdy... :)
Got the Apply to All JSFL extension from the Exchange and there is one thing that's bugging me a lot and I somehow cannot fix it... (FMX 2004)
http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=1020053
If you run that one, it has a dialog box which is coming from this XML file...
<dialog id="s_command" title="Select command to apply" buttons="accept,cancel">
<vbox>
<label value="Choose Atom Command" align="left"/>
<listbox id="command" rows="6">
<listitem label="Apply Publish Settings" value="publish settings 2" selected="true" />
<listitem label="Save and Compact" value="save and compact" selected="false" />
<listitem label="Publish" value="publish"/>
<listitem label="Frame Rate" value="Change Frame Rate"/>
<listitem label="Save As" value="Save As"/>
<!-- Add new items here -->
</listbox>
</vbox>
</dialog>
I probably doing it wrong, but the 'selected' set in the first and second listitem are not working... No matter what I do, it displays the default value which is the second item... But I want to change the default to be the first item...
Does anybody know how to do that??? Thanks... :)
I have copied the JSFL file just in case...
Apply To All.jsfl
/**
@Description :
Apply to all
Apply single command to all opened files
For Flash MX 2004
@Author :
DINH Viet Huy <huy@hotpop.com>
http://noname.dyndns.org/ (website coming soon !!!)
@Versions :
30/10/2004 : Original version
01/11/2004 : Optimisation time !!!
**/
scripts_path=fl.configURI + "Commands/Atomic Commands/";
ata_apply=function()
{
var s=scripts_path+res.command+".jsfl"; //get the name from the
var l=flash.documents.length;
var r=0;
while(l>0)
{
//get params for each document with last settings as a param and save params for next iteration
//fl.trace(s);
r=fl.runScript(s,"r_params",r);
//run batch with defined params
if(!fl.runScript(s,"r_apply",flash.documents[--l],r))
return;
}
}
//main body
res=document.xmlPanel(fl.configURI +"Commands/ui/Apply To All.xml");
for (var prop in res) {
fl.trace("property " + prop + " = " + res[prop]);
}
if(res.dismiss == "accept")
{
ata_apply();
}
Publish settings 2.jsfl.as
/**
@Description :
Set publish setting for Apply to all
Publish single document
For Flash MX 2004
@Author :
DINH Viet Huy <huy@hotpop.com>
http://noname.dyndns.org/ (website coming soon !!!)
@Versions :
30/10/2004 : Original version
02/11/2004 : New dialog box
**/
function r_params(s)
{
if(s==0)
{
var res=document.xmlPanel(fl.configURI +"Commands/ui/Publish Settings.xml");
if(res.dismiss == "accept")
{
//fl.trace("\""+res.fileset+"\"")
if(new String(res.fileset)=="unknown:")
{
fl.trace("error you haven't choose a publish setting file")
return -1
}
return[res.fileset,res.deleteset]
}else{
return -1
}
}
return s
}
function r_apply(d,s)
{
if(s==-1) return false;
with(d)
{
s=s.split(",");
//fl.trace(s[0]);
var n=importPublishProfile(s[0]);
n=currentPublishProfile=publishProfiles[n];
if(s[1]=="true")
{
while(publishProfiles[0]!=n)
{
currentPublishProfile=publishProfiles[0];
deletePublishProfile();
}
while(publishProfiles.length>1)
{
currentPublishProfile=publishProfiles[1];
deletePublishProfile();
}
}
// d.save()
d.saveAndCompact(true);
}
return true;
}
Got the Apply to All JSFL extension from the Exchange and there is one thing that's bugging me a lot and I somehow cannot fix it... (FMX 2004)
http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=1020053
If you run that one, it has a dialog box which is coming from this XML file...
<dialog id="s_command" title="Select command to apply" buttons="accept,cancel">
<vbox>
<label value="Choose Atom Command" align="left"/>
<listbox id="command" rows="6">
<listitem label="Apply Publish Settings" value="publish settings 2" selected="true" />
<listitem label="Save and Compact" value="save and compact" selected="false" />
<listitem label="Publish" value="publish"/>
<listitem label="Frame Rate" value="Change Frame Rate"/>
<listitem label="Save As" value="Save As"/>
<!-- Add new items here -->
</listbox>
</vbox>
</dialog>
I probably doing it wrong, but the 'selected' set in the first and second listitem are not working... No matter what I do, it displays the default value which is the second item... But I want to change the default to be the first item...
Does anybody know how to do that??? Thanks... :)
I have copied the JSFL file just in case...
Apply To All.jsfl
/**
@Description :
Apply to all
Apply single command to all opened files
For Flash MX 2004
@Author :
DINH Viet Huy <huy@hotpop.com>
http://noname.dyndns.org/ (website coming soon !!!)
@Versions :
30/10/2004 : Original version
01/11/2004 : Optimisation time !!!
**/
scripts_path=fl.configURI + "Commands/Atomic Commands/";
ata_apply=function()
{
var s=scripts_path+res.command+".jsfl"; //get the name from the
var l=flash.documents.length;
var r=0;
while(l>0)
{
//get params for each document with last settings as a param and save params for next iteration
//fl.trace(s);
r=fl.runScript(s,"r_params",r);
//run batch with defined params
if(!fl.runScript(s,"r_apply",flash.documents[--l],r))
return;
}
}
//main body
res=document.xmlPanel(fl.configURI +"Commands/ui/Apply To All.xml");
for (var prop in res) {
fl.trace("property " + prop + " = " + res[prop]);
}
if(res.dismiss == "accept")
{
ata_apply();
}
Publish settings 2.jsfl.as
/**
@Description :
Set publish setting for Apply to all
Publish single document
For Flash MX 2004
@Author :
DINH Viet Huy <huy@hotpop.com>
http://noname.dyndns.org/ (website coming soon !!!)
@Versions :
30/10/2004 : Original version
02/11/2004 : New dialog box
**/
function r_params(s)
{
if(s==0)
{
var res=document.xmlPanel(fl.configURI +"Commands/ui/Publish Settings.xml");
if(res.dismiss == "accept")
{
//fl.trace("\""+res.fileset+"\"")
if(new String(res.fileset)=="unknown:")
{
fl.trace("error you haven't choose a publish setting file")
return -1
}
return[res.fileset,res.deleteset]
}else{
return -1
}
}
return s
}
function r_apply(d,s)
{
if(s==-1) return false;
with(d)
{
s=s.split(",");
//fl.trace(s[0]);
var n=importPublishProfile(s[0]);
n=currentPublishProfile=publishProfiles[n];
if(s[1]=="true")
{
while(publishProfiles[0]!=n)
{
currentPublishProfile=publishProfiles[0];
deletePublishProfile();
}
while(publishProfiles.length>1)
{
currentPublishProfile=publishProfiles[1];
deletePublishProfile();
}
}
// d.save()
d.saveAndCompact(true);
}
return true;
}