This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* it's good to use snippet */ | |
alert("done"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
get all texts from text layer in photoshop. | |
*/ | |
function get_all_text (document) { | |
var doc = document || app.activeDocument; | |
if(doc != null || doc != undefined){ | |
var str = ""; | |
var layer = null; | |
var objArray = []; | |
var text = ""; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try{ | |
main(); | |
}catch(e) { | |
var message = "Error String: " + e.description + "\n"; | |
message += "Line: " + e.line; | |
alert(message); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function build_string_from_name_page_file (name_page_file) { | |
var all_name_string = ""; | |
var tmp_arr = []; | |
var tmp_str = ""; | |
if(name_page_file !=null) { | |
all_name_string = "::"; | |
name_page_file.open("r"); | |
while(!name_page_file.eof){ | |
tmp_str = name_page_file.readln(); | |
tmp_arr = tmp_str.split("\t"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var grep_keyword = "(?<=Pg 000\\t).+(?=\\r)"; | |
var grep_keyword = "(?<=(\\(See display ad Pg ))(lkh|lmy).+(?=\\))"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function write_text_file(text, path, file_name) { | |
// alert(my_file.name.split("__")[0]); | |
var file_full_url = path + "/" + file_name; | |
var my_file = new File(file_full_url); | |
my_file.open("w"); | |
my_file.write(text); | |
my_file.close(); | |
return my_file; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function replace_this_page (arr, text, num) { | |
for(var i = 0, len = arr.length;i<len;i++){ | |
if(arr[i] == num){ | |
arr.splice(i,1); arr.unshift(text);} | |
} | |
return arr; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function remove_file_extension(name, extensions) { | |
var my_extensions = extensions || ["jpg","gif","png","psd","eps","indd","INDL","ai","txt","pdf"]; | |
var reg_string = "\.(" + my_extensions.join("|") + ")$"; | |
var my_reg = new RegExp( reg_string, "i" ); | |
name = name.replace(my_reg, ''); | |
return name; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function record_time(startTime) { | |
var secs = Math.round(((new Date()).getTime() - startTime)/1000); | |
if(secs === 0) return 1; | |
var str = "", | |
hr = Math.floor(secs / 3600), | |
min = Math.floor((secs - (hr * 3600))/60), | |
sec = secs - (hr * 3600) - (min * 60); | |
if(hr>0) { str += hr + "h:"; } | |
if(min>0) { str += min + "mn:"; } | |
if(sec>0) { str += sec + "s"; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function read_name_page_file (name_page_file) { | |
var name_and_page = []; | |
var tmp_arr = []; | |
var tmp_str = ""; | |
if(name_page_file !=null) { | |
name_page_file.open("r"); | |
while(!name_page_file.eof){ | |
tmp_str = name_page_file.readln(); | |
tmp_arr = tmp_str.split("\t"); |
OlderNewer