zoukankan      html  css  js  c++  java
  • iOS启动页自动命名工具

    前段时间做了个app模板,需要大量打包app。其中就涉到启动页命名。设计师给的是中文命名。哎,如果让设计同学一张一张给,可能也会有些麻烦。无奈,自己写了利用

    AppleScript写了个工具,在这里分享出来。

    主要思路就是判断图片的高,根据不同高度命不同的名字。

    iPhone4:640*960

    iPhone5:640*1136

    iPhone6:750*1334

    iPhone6P:1242*2208

    set iPhone4_name to "Default-480h@2x.png" as string
    set iPhone5_name to "Default-568h@2x.png" as string
    set iPhone6_name to "Default-667h@2x.png" as string
    set iPhone6P_name to "Default-736h@2x.png" as string
    
    set f to choose folder
    tell application "Finder"
    	set all_files to (files of entire contents of f) as alias list
    end tell
    
    repeat with this_file in all_files
    	try
    		tell application "Image Events"
    			set this_image to open this_file
    			-- extract the value for the metadata tag
    			tell this_image
    				set the image_height to the value of metadata tag "pixelHeight"
    			end tell
    			-- purge the open image data
    			close this_image
    			
    			if the image_height = 960 then
    				set the name of this_file to iPhone4_name as string
    			else if the image_height = 1136 then
    				set the name of this_file to iPhone5_name as string
    			else if the image_height = 1334 then
    				set the name of this_file to iPhone6_name as string
    			else if the image_height = 2208 then
    				set the name of this_file to iPhone6P_name as string
    			else
    				display dialog buttons {"Cancel"} default button 1
    			end if
    			
    		end tell
    	on error error_message
    		display dialog error_message
    	end try
    end repeat
    

    我也打了个包,下载下来就可以用了。

    自动命名启动图.zip 

  • 相关阅读:
    数据结构 trie 树 入门练手 POJ 3630 Phone List
    回溯法求 1~n 的排列
    POJ 1988 Cube Stacking (并查集,节点到根节点的距离题目)
    Ubuntu下的截图软件
    git使用方法
    在Linux下安装ADT
    在Linux下安装Android SDK
    在Linux下安装Java JDK
    研发项目风险因素差异性
    关于C#的partial修饰符
  • 原文地址:https://www.cnblogs.com/kw-ios/p/5885887.html
Copyright © 2011-2022 走看看