技术联盟

Mac下制作简单的ox应用

先上张图片

制作mac下面确定Jenkis的应用
on run {input, parameters}

display dialog “输入执行动作:(1是启动,2是关闭).” default answer “1” buttons {“确定”, “取消”} with title “启动Jenkins” default button 1
if the button returned of the result is “确定” then
set executeType to text returned of the result
end if
end run

echo +———————————————————-+
echo + 1是启动,2是停止 +
echo +———————————————————-+
printf ‘Input your want execute Parameter:’
read executeType
printf ‘you Input 类型 is $executeType’
printf “\n”

cd /Users/jason/Documents/developer_tools/Tomcat/bin
pwd

if [[ $executeType == 1 ]];then
./startup.sh
printf 启动成功
printf “\n”
else
./shutdown.sh
printf “关闭成功”
printf “\n”
fi

 

mac制作截图工具
on run {input, parameters}

display dialog “输入文件的名称(例如1、2).” default answer “1” buttons {“确定”, “取消”} with title “Android 截图” default button 1
if the button returned of the result is “确定” then
set executeType to text returned of the result
end if
end run

#!/bin/sh

echo +———————————————————-+
echo + 输入名称 +
echo +———————————————————-+
printf “Input your want execute Parameter:”
read executeType
printf “you Input 名称 is $executeType”
printf “\n”
cd ~/Desktop/
/Users/jason/Documents/developer_tools/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb shell screencap -p | perl -pe ‘s/\x0D\x0A/\x0A/g’ > $executeType.png

adb shell screencap -p 手机上路径

电脑上路径
adb shell screencap -p | perl -pe ‘s/\x0D\x0A/\x0A/g’ > $executeType.png

 

其他

on run {input, parameters}

display alert “《” & (input as text) & “》” & “输入参数” //弹出提醒对话框
end run

on run {input, parameters}
tell application “Terminal” //打开指定的应用,需要添加双引号
activate
end tell
return input
end run

 

欢迎交流指正:411437734@qq.com

Share this:

码字很辛苦,转载请注明来自技术联盟《Mac下制作简单的ox应用》

评论