mirror of https://github.com/tp4a/teleport
Merge branch 'feature/mstsc' of github.com:tp4a/teleport into feature/mstsc
commit
10142bfef6
|
@ -381,7 +381,7 @@
|
||||||
};
|
};
|
||||||
buildConfigurationList = C149EBF315D5214600B1F558 /* Build configuration list for PBXProject "TP-Assist" */;
|
buildConfigurationList = C149EBF315D5214600B1F558 /* Build configuration list for PBXProject "TP-Assist" */;
|
||||||
compatibilityVersion = "Xcode 10.0";
|
compatibilityVersion = "Xcode 10.0";
|
||||||
developmentRegion = English;
|
developmentRegion = en;
|
||||||
hasScannedForEncodings = 0;
|
hasScannedForEncodings = 0;
|
||||||
knownRegions = (
|
knownRegions = (
|
||||||
en,
|
en,
|
||||||
|
|
|
@ -6,58 +6,17 @@ on scriptRun(argsCmd, argsProfile, argsTitle)
|
||||||
end scriptRun
|
end scriptRun
|
||||||
|
|
||||||
on CommandRun(theCmd, theProfile, theTitle)
|
on CommandRun(theCmd, theProfile, theTitle)
|
||||||
tell application "iTerm"
|
try
|
||||||
if it is not running then
|
tell application "iTerm"
|
||||||
tell application "iTerm"
|
if it is not running then
|
||||||
activate
|
|
||||||
delay 0.5
|
|
||||||
try
|
|
||||||
close first window
|
|
||||||
end try
|
|
||||||
end tell
|
|
||||||
|
|
||||||
tell application "iTerm"
|
|
||||||
try
|
|
||||||
create window with profile theProfile
|
|
||||||
on error msg
|
|
||||||
create window with profile "Default"
|
|
||||||
end try
|
|
||||||
tell the current window
|
|
||||||
tell the current session
|
|
||||||
delay 0.5
|
|
||||||
set name to theTitle
|
|
||||||
set profile to theProfile
|
|
||||||
write text theCmd
|
|
||||||
delay 0.5
|
|
||||||
write text ""
|
|
||||||
end tell
|
|
||||||
end tell
|
|
||||||
end tell
|
|
||||||
else
|
|
||||||
--assume that iTerm is open and open a new tab
|
|
||||||
try
|
|
||||||
tell application "iTerm"
|
tell application "iTerm"
|
||||||
activate
|
activate
|
||||||
tell the current window
|
delay 0.5
|
||||||
try
|
try
|
||||||
create tab with profile theProfile
|
close first window
|
||||||
on error msg
|
end try
|
||||||
create tab with profile "Default"
|
|
||||||
end try
|
|
||||||
tell the current tab
|
|
||||||
tell the current session
|
|
||||||
delay 0.5
|
|
||||||
set name to theTitle
|
|
||||||
write text theCmd
|
|
||||||
delay 0.5
|
|
||||||
write text ""
|
|
||||||
end tell
|
|
||||||
end tell
|
|
||||||
end tell
|
|
||||||
end tell
|
end tell
|
||||||
on error msg
|
|
||||||
-- if all iTerm windows are closed the app stays open. In this scenario iTerm has
|
|
||||||
-- no "current window" and will give an error when trying to create the new tab.
|
|
||||||
tell application "iTerm"
|
tell application "iTerm"
|
||||||
try
|
try
|
||||||
create window with profile theProfile
|
create window with profile theProfile
|
||||||
|
@ -68,13 +27,59 @@ on CommandRun(theCmd, theProfile, theTitle)
|
||||||
tell the current session
|
tell the current session
|
||||||
delay 0.5
|
delay 0.5
|
||||||
set name to theTitle
|
set name to theTitle
|
||||||
|
set profile to theProfile
|
||||||
write text theCmd
|
write text theCmd
|
||||||
delay 0.5
|
delay 0.5
|
||||||
write text ""
|
write text ""
|
||||||
end tell
|
end tell
|
||||||
end tell
|
end tell
|
||||||
end tell
|
end tell
|
||||||
end try
|
else
|
||||||
end if
|
--assume that iTerm is open and open a new tab
|
||||||
end tell
|
try
|
||||||
|
tell application "iTerm"
|
||||||
|
activate
|
||||||
|
tell the current window
|
||||||
|
try
|
||||||
|
create tab with profile theProfile
|
||||||
|
on error msg
|
||||||
|
create tab with profile "Default"
|
||||||
|
end try
|
||||||
|
tell the current tab
|
||||||
|
tell the current session
|
||||||
|
delay 0.5
|
||||||
|
set name to theTitle
|
||||||
|
write text theCmd
|
||||||
|
delay 0.5
|
||||||
|
write text ""
|
||||||
|
end tell
|
||||||
|
end tell
|
||||||
|
end tell
|
||||||
|
end tell
|
||||||
|
on error msg
|
||||||
|
-- if all iTerm windows are closed the app stays open. In this scenario iTerm has
|
||||||
|
-- no "current window" and will give an error when trying to create the new tab.
|
||||||
|
tell application "iTerm"
|
||||||
|
try
|
||||||
|
create window with profile theProfile
|
||||||
|
on error msg
|
||||||
|
create window with profile "Default"
|
||||||
|
end try
|
||||||
|
tell the current window
|
||||||
|
tell the current session
|
||||||
|
delay 0.5
|
||||||
|
set name to theTitle
|
||||||
|
write text theCmd
|
||||||
|
delay 0.5
|
||||||
|
write text ""
|
||||||
|
end tell
|
||||||
|
end tell
|
||||||
|
end tell
|
||||||
|
end try
|
||||||
|
end if
|
||||||
|
end tell
|
||||||
|
on error msg
|
||||||
|
display dialog "ERROR: " & msg
|
||||||
|
end try
|
||||||
|
|
||||||
end CommandRun
|
end CommandRun
|
||||||
|
|
|
@ -1,76 +1,83 @@
|
||||||
on scriptRun(argsCmd, argsProfile, argsTitle)
|
on scriptRun(argsCmd, argsProfile, argsTitle)
|
||||||
set theCmd to (argsCmd)
|
set theCmd to (argsCmd)
|
||||||
set theProfile to (argsProfile)
|
set theProfile to (argsProfile)
|
||||||
set theTitle to (argsTitle)
|
set theTitle to (argsTitle)
|
||||||
CommandRun(theCmd, theProfile, theTitle)
|
CommandRun(theCmd, theProfile, theTitle)
|
||||||
end scriptRun
|
end scriptRun
|
||||||
|
|
||||||
on CommandRun(theCmd, theProfile, theTitle)
|
on CommandRun(theCmd, theProfile, theTitle)
|
||||||
tell application "Terminal"
|
try
|
||||||
if it is not running then
|
tell application "Terminal"
|
||||||
--if this is the first time Terminal is running you have specify window 1
|
if it is not running then
|
||||||
--if you dont do this you will get two windows and the title wont be set
|
--if this is the first time Terminal is running you have specify window 1
|
||||||
activate
|
--if you dont do this you will get two windows and the title wont be set
|
||||||
delay 1.0
|
activate
|
||||||
set newTerm to do script theCmd in window 1
|
delay 3.0
|
||||||
set newTerm's current settings to settings set theProfile
|
set newTerm to do script theCmd in window 1
|
||||||
set custom title of front window to theTitle
|
set newTerm's current settings to settings set theProfile
|
||||||
|
set custom title of front window to theTitle
|
||||||
delay 1.0
|
|
||||||
reopen
|
delay 1.0
|
||||||
activate
|
|
||||||
tell application "System Events" to key code 36
|
|
||||||
else
|
|
||||||
--Terminal is running get the window count
|
|
||||||
set windowCount to (count every window)
|
|
||||||
if windowCount = 0 then
|
|
||||||
--Terminal is running but no windows are open
|
|
||||||
--run our script in a new window
|
|
||||||
reopen
|
reopen
|
||||||
activate
|
activate
|
||||||
|
tell application "System Events" to key code 36
|
||||||
do script theCmd in window 1
|
|
||||||
|
|
||||||
set current settings of selected tab of front window to settings set theProfile
|
|
||||||
set title displays custom title of front window to true
|
|
||||||
set custom title of selected tab of front window to theTitle
|
|
||||||
|
|
||||||
delay 1.0
|
|
||||||
reopen
|
|
||||||
activate
|
|
||||||
tell application "System Events" to key code 36
|
|
||||||
|
|
||||||
else
|
else
|
||||||
--Terminal is running and we have a window run in a new tab
|
--Terminal is running get the window count
|
||||||
reopen
|
set windowCount to (count every window)
|
||||||
activate
|
if windowCount = 0 then
|
||||||
|
--Terminal is running but no windows are open
|
||||||
tell application "System Events"
|
--run our script in a new window
|
||||||
tell process "Terminal"
|
reopen
|
||||||
delay 0.5
|
activate
|
||||||
keystroke "t" using {command down}
|
|
||||||
|
do script theCmd in window 1
|
||||||
|
|
||||||
|
set current settings of selected tab of front window to settings set theProfile
|
||||||
|
set title displays custom title of front window to true
|
||||||
|
set custom title of selected tab of front window to theTitle
|
||||||
|
|
||||||
|
delay 1.0
|
||||||
|
reopen
|
||||||
|
activate
|
||||||
|
tell application "System Events" to key code 36
|
||||||
|
|
||||||
|
else
|
||||||
|
--Terminal is running and we have a window run in a new tab
|
||||||
|
reopen
|
||||||
|
activate
|
||||||
|
|
||||||
|
tell application "System Events"
|
||||||
|
tell process "Terminal"
|
||||||
|
delay 0.5
|
||||||
|
keystroke "t" using {command down}
|
||||||
|
end tell
|
||||||
end tell
|
end tell
|
||||||
end tell
|
|
||||||
|
reopen
|
||||||
reopen
|
activate
|
||||||
activate
|
do script theCmd in front window
|
||||||
do script theCmd in front window
|
|
||||||
|
set current settings of selected tab of front window to settings set theProfile
|
||||||
set current settings of selected tab of front window to settings set theProfile
|
set title displays custom title of front window to true
|
||||||
set title displays custom title of front window to true
|
set custom title of selected tab of front window to theTitle
|
||||||
set custom title of selected tab of front window to theTitle
|
|
||||||
|
delay 1.0
|
||||||
delay 1.0
|
reopen
|
||||||
reopen
|
activate
|
||||||
activate
|
tell application "System Events" to key code 36
|
||||||
tell application "System Events" to key code 36
|
|
||||||
|
end if
|
||||||
|
|
||||||
|
--set current settings of selected tab of front window to settings set theProfile
|
||||||
|
--set title displays custom title of front window to true
|
||||||
|
--set custom title of selected tab of front window to theTitle
|
||||||
end if
|
end if
|
||||||
|
|
||||||
# set current settings of selected tab of front window to settings set theProfile
|
end tell
|
||||||
# set title displays custom title of front window to true
|
|
||||||
# set custom title of selected tab of front window to theTitle
|
on error msg
|
||||||
end if
|
display dialog "ERROR: " & msg
|
||||||
|
end try
|
||||||
end tell
|
|
||||||
|
|
||||||
end CommandRun
|
end CommandRun
|
||||||
|
|
|
@ -3,12 +3,12 @@
|
||||||
TPAssist
|
TPAssist
|
||||||
*/
|
*/
|
||||||
|
|
||||||
"app_name" = "Teleport助手";
|
"app_name" = "Teleport Assist";
|
||||||
|
|
||||||
//=============================================
|
//=============================================
|
||||||
// for About Window
|
// for About Window
|
||||||
//=============================================
|
//=============================================
|
||||||
"version" = "Version: ";
|
"version" = "Version: ";
|
||||||
"app_full_name" = "Teleport Assist for macOS";
|
"app_full_name" = "Teleport Assist for macOS";
|
||||||
"copyright" = "Copyright © 2017~2018 TP4A. All rights reserved.";
|
"copyright" = "Copyright © 2017~2019, tp4a.com. All rights reserved.";
|
||||||
"visit_tp4a_website" = "Visit Teleport Website"
|
"visit_tp4a_website" = "Visit Teleport Website"
|
||||||
|
|
|
@ -28,8 +28,10 @@
|
||||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||||
<key>LSUIElement</key>
|
<key>LSUIElement</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
<key>NSAppleEventsUsageDescription</key>
|
||||||
|
<string></string>
|
||||||
<key>NSHumanReadableCopyright</key>
|
<key>NSHumanReadableCopyright</key>
|
||||||
<string>Copyright © 2017~2018 TP4A. All rights reserved.</string>
|
<string>Copyright © 2017~2019, tp4a.com. All rights reserved.</string>
|
||||||
<key>NSMainNibFile</key>
|
<key>NSMainNibFile</key>
|
||||||
<string>MainMenu</string>
|
<string>MainMenu</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -15,5 +15,5 @@
|
||||||
"about " = "关于 ";
|
"about " = "关于 ";
|
||||||
"version" = "版本:";
|
"version" = "版本:";
|
||||||
"app_full_name" = "Teleport助手 - macOS";
|
"app_full_name" = "Teleport助手 - macOS";
|
||||||
"copyright" = "© 2017~2018 TP4A,保留所有权利。";
|
"copyright" = "© 2017~2019,tp4a.com。保留所有权利。";
|
||||||
"visit_tp4a_website" = "访问 Teleport 网站";
|
"visit_tp4a_website" = "访问 Teleport 网站";
|
||||||
|
|
Loading…
Reference in New Issue