-
-
Save chrisyour/662796 to your computer and use it in GitHub Desktop.
// # I've assumed you've downloaded and installed the Flash CS4/CS5 Project Panel update at: http://www.gskinner.com/blog/archives/2010/07/project_panel_u.html | |
// # 1. Create this file in: /Users/{you}/Library/Application Support/Adobe/Flash CS4/en/Configuration/Commands | |
// # 2. Then go to Flash => Keyboard Shortcuts... | |
// # 3. Create your shortcut under the Commands menu, I use 'Cmd+Opt+P' | |
function call_method(p_panelName, p_function, p_param){ | |
l = fl.swfPanels.length; | |
if (l == 0) return 'false'; | |
for (i=0; i<l; i++){ | |
if (fl.swfPanels[i].name == p_panelName) return (p_param == null) ? fl.swfPanels[i].call(p_function) : fl.swfPanels[i].call(p_function, p_param); | |
} | |
return 'false'; | |
} | |
call_method('gProject', 'runCompileList'); |
No problem. Glad this gist was useful.
Chris
Well for now I have just went with a catch all because it seems Flash doesn't give you the ability to catch all open scripts into an array like the fl.documents and then save each individual one. Placing fl.saveAll() after the method call but before fl.openDocument lets Flash prompt you to save any open documents which haven't been saved yet. So a couple extra clicks but it's all worth it. Thanks alot. Here is what the code looks like now.
// # I've assumed you've downloaded and installed the Flash CS4/CS5 Project Panel update at: http://www.gskinner.com/blog/archives/2010/07/project_panel_u.html
// # 1. Create this file in: /Users/{you}/Library/Application Support/Adobe/Flash CS4/en/Configuration/Commands
// # 2. Then go to Flash => Keyboard Shortcuts...
// # 3. Create your shortcut under the Commands menu, I use 'Cmd+Opt+P'
function call_method(p_panelName, p_function, p_param){
// # Save all open documents before testing project - Stat1124 - 01052011
fl.saveAll();
fl.openDocument
l = fl.swfPanels.length;
if (l == 0) return 'false';
for (i=0; i<l; i++){
if (fl.swfPanels[i].name == p_panelName) return (p_param == null) ? fl.swfPanels[i].call(p_function) : fl.swfPanels[i].call(p_function, p_param);
}
return 'false';
}
call_method('gProject', 'runCompileList');
Great. Will Do! Chris Thanks for your time, it's appreciated.