View Full Version : Compilare codice c++ da Textwrangler
Qualcuno conosce un applescript o simile per compilare direttamente da Textwrangler, evitando di digitare la cli a manina?
Un p̣ come viene fatto col devc++ su win...
vaḅ, se serve, me lo sono fatto io
(* compile and execute source code, as Devc++ does
Author flapane.com
rev. 12-sep-08
*)
tell application "TextWrangler"
set the_file to file of text document 1
end tell
set AppleScript's text item delimiters to ":"
set source_file to the last text item of (the_file as string)
set AppleScript's text item delimiters to ""
set source_file_ext to characters 1 thru ((offset of "." in source_file) - 1) of source_file as string
tell application "Finder"
set the_folder to container of the_file as alias
end tell
tell application "Terminal"
activate
set shell_script to "cd " & (quoted form of POSIX path of the_folder) & "; g++ " & source_file & " -o " & source_file_ext & "; " & source_file_ext & "; exit"
if (count windows) is 0 then
do script shell_script
else
do script shell_script in the front window
end if
end tell
vBulletin® v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.