- (IBAction) charlieImputText:(id)sender {
NSAppleScript *keystrokeReturn = [[NSAppleScript alloc] initWithSource:@"tell application \"System Events\" to keystroke return"];
[keystrokeReturn executeAndReturnError:nil];
[progressBarText startAnimation:self];
charlieImputSelf = [sender stringValue];
NSAppleScript *sendCharlieImput = [[NSAppleScript alloc] initWithSource:[NSString stringWithFormat:@"tell application \"Terminal\" to do shell script %@", charlieImputSelf]];
[sendCharlieImput executeAndReturnError:nil];
NSDictionary* errorDict;
NSAppleScript* script=[[NSAppleScript alloc]
initWithContentsOfURL:[NSURL fileURLWithPath:@"/applications/jarvis/scripts/getTextCharlieResponce.scpt" ]
error:&errorDict];
NSAppleEventDescriptor* desc=[script executeAndReturnError:&errorDict];
NSString* result=[desc stringValue];
self.charlieOutput.stringValue = result;
charlieOutput.textColor = [NSColor greenColor];
[script release];
[progressBarText stopAnimation:self];
}
私はこれにとても慣れていないので、別の質問でこのコードの問題を投稿しましたが、誰かがこれで私に応答しました:
シェルスクリプトを実行するには、引数を引用する必要があります。
これは何を意味するのでしょうか??誰かが例を示すことができますか?
すみません、この新しい時代の用語が何を意味するのかわかりません!:D