Shell - objective-c

JB sundown at pacifier.com
Sat Jun 24 17:35:24 EDT 2017


Compile the following objective-c code as argv_objective_c

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        NSLog(@"\nArgument 1: %s\n", argv[1]);
        NSLog(@"\nArgument 2: %s\n", argv[2]);
        NSLog(@"\nArgument 3: %s\n", argv[3]);
    }
    
    return 0;
}


Enter the following code in a button;

on mouseUp
   set the defaultFolder to "~/Desktop"
   
   /* DO NOT USE ANY SPACES IN ARGUMENTS */
   put "One" into tFILE1
   put "Two" into tFILE2
   put "Three" into tFILE3
   put shell( "./argv_objective_c" && tFILE1 && tFILE2 && tFILE3) into pData
   put pData into fld id <YOURFIELD>
   beep 2
end mouseUp


More information about the use-livecode mailing list