Skip to content

Instantly share code, notes, and snippets.

@yonglam
Created February 4, 2016 09:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yonglam/d076f6032d320c6169e5 to your computer and use it in GitHub Desktop.
Save yonglam/d076f6032d320c6169e5 to your computer and use it in GitHub Desktop.
Package a ipa file
on open of listFile set srcFile to the first item of listFile set myFolderName to "Payload" set wechatFileName to "wechat.ipa" tell application "Finder" if not (exists folder myFolderName of desktop) then set wechatItem to make new folder at desktop with properties {name:myFolderName} end if duplicate srcFile to folder myFolderName of desktop with replacing --set itemPath to POSIX path of (folder "Wechat" of desktop as alias) --set thePath to POSIX path of (desktop as alias) & "Wechat.zip" --do shell script "zip -r " & quoted form of thePath & " " & quoted form of itemPath do shell script "cd ~/desktop && zip -r " & wechatFileName & " " & myFolderName delay 1 delete folder myFolderName delay 1 beep tell application "Google Chrome" activate set theUrl to "http://rdm.wsd.com/sign.jsp" if (count every window) = 0 then make new window end if set found to false set theTabIndex to -1 repeat with theWindow in every window set theTabIndex to 0 repeat with theTab in every tab of theWindow set theTabIndex to theTabIndex + 1 if theTab's URL = theUrl then set found to true exit repeat end if end repeat if found then exit repeat end if end repeat if found then tell theTab to reload set theWindow's active tab index to theTabIndex set index of theWindow to 1 else tell window 1 to make new tab with properties {URL:theUrl} end if end tell end tell end open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment