char* cmd=(char*) "osascript -e 'set myFile to choose file with prompt \"Please select
a '.txt' file:\" of type {\"public.plain-text\"}'";
system(cmd);
在上面的代码中,我想使用applescript变量" File"在C ++中,或以某种方式将其值存储在C ++变量中。有没有办法做到这一点? 我试过这个:
char* filename;
char* cmd;
sprintf(cmd, "osascript -e 'set %s to choose file with prompt \"Please select
a '.txt' file to encrypt:\" of type {\"public.plain-text\"}'", filename);
system(cmd);
但它没有用。