Created
August 6, 2011 07:14
-
-
Save warp/1129122 to your computer and use it in GitHub Desktop.
Dump text layers from photoshop psd files
This file contains 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
#!/usr/bin/env ruby | |
content = File.open(ARGV[0], 'rb') {|io| io.read } | |
File.open(ARGV[0] + '.txt', 'w') do |file| | |
content.scan /Txt TEXT[\W]*([^\x0C]*)\x0C/ do |match| | |
s = $1.gsub(/\x00/, '').force_encoding('UTF-8') | |
file << s | |
puts s | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment