View MOJavaScriptObject.m
@import JavaScriptCore;
/// Retaining MOJavaScriptObject retains your JSContext/JSObject as well
@interface MOJavaScriptObject : NSObject
@property (readonly) JSObjectRef JSObject;
@property (readonly) JSContextRef JSContext;
View accept-all-suggestions.js
function run(){
var shouldRun = confirm("Are you sure you want to accept all suggestions?\n\n(Note: Depending on the number of suggestions you have, this script may take a few seconds to run.)");
if(!shouldRun) return false;
var events = [ "mouseover", "mousedown", "click", "mouseup" ];
var suggestionButtons = Array.from(document.querySelectorAll("[role='button'][aria-label='Accept suggestion']"));
suggestionButtons.forEach((el) => {
events.forEach((eventName, i) => {
View get-unique-user-styling.js
var getDefaultStyling = function(tagName){
if(!tagName) tagName = "dummy-tag-name";
// Create dummy iframe
var iframe = document.createElement("iframe");
document.body.appendChild(iframe);
// Create element within the iframe's document
View shape-layer-to-marquee.js
var document = context.document;
// Find first bitmap and shape in selection
var bitmapLayer = document.selectedLayersOfClass(MSBitmapLayer)[0];
if(!bitmapLayer) return;
var shapeLayer = document.selectedLayersOfClass(MSShapeGroup)[0];
View export.js
var size = [MSExportSize sizeWithScale:4 name:"@4x" format:@"png"];
var exportRequests = [MSSliceMaker slicesFromExportableLayer:selection sizes:[ size ]];
[[MSSliceExporter new] exportSlices:exportRequests];
View Resizer.cocoascript.js
var original = context.selection.firstObject();
var originalArtboard = original.parentArtboard();
var artboards = context.document.artboards();
var enumerator = artboards.objectEnumerator();
var artboard;
while((artboard = enumerator.nextObject())){
if(artboard.isEqual_(originalArtboard)) continue;
View NSFetchedResultsController+UICollectionView.m
@interface YourNSFetchedResultsControllerDelegate () <NSFetchedResultsControllerDelegate>
@end
@implementation YourNSFetchedResultsControllerDelegate {
UICollectionView *_collectionView;
NSMutableArray *_collectionViewUpdatesQueue;
View G510 Yosemite Notes.md
View MCTextFormatConverter.h
#import <Foundation/Foundation.h>
@interface MCTextFormatConverter : NSObject
+ (NSString*) convertTextInResponderToHTML:(UIView<UITextInput>*)view convertSelectionOnly:(BOOL)convertSelectionOnly;
+ (NSAttributedString*) htmlToAttributedString:(NSString*)html;
@end
View gist:d9b46b59834dc781cd6e

Weird $ Variable. On further inspection seems to be a light implemtation of a variable from ExtendScript?? http://jongware.mit.edu/idcs6js/pc_%24.html

$.evalFile(filename:String, timeout:int) // not sure if fw cares about timeout
$.getenv(str:String) // gets enviroment variables...interesting

Fireworks Document

dom.saveAllAsync()
dom.saveDocumentAsync()
dom.saveDocumentAsAsync(doc, saveAsCmd:Boolean)