简体   繁体   English

Ruby Sketchup ...退出

[英]Ruby Sketchup … exit

The following script is executed within Sketchup as a ruby script. 以下脚本在Sketchup中作为ruby脚本执行。

notepad = File.absolute_path("notepad.exe", "C:/Windows")
puts "fileName :"+notepad
exec((notepad))

When closing the notepad.exe windows ... it also close/quit Sketchup. 关闭notepad.exe窗口时...它也会关闭/退出Sketchup。 How to only close notepad.exe and not Sketchup ? 如何只关闭notepad.exe而不关闭Sketchup?

Thks THKS

You are using exec to run notepad, but according to documentation exec replaces the current process. 您正在使用exec运行记事本,但根据文档exec 替换当前进程。 Try running the command using system method instead - it executes command in a subshell 尝试使用system方法运行命令 - 它在子shell中执行命令

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM