EDIT : Perfect Fix - found the close function syntax...
Fixed but having to try and setup GIT on mac to push the fix so if this keeps dipping me around you can make the fix yourself to the script.
I would only try this if you can read script. Use Ctrl-F to find the code I present below. Search for "charIDToTypeID( "Cls " );"
Find the commands (there are two like this) in the image exporting functions (single and merge versions)
Unfortunately didn't work in CS5... still the same crash at the same point.
If you applied that fix to both functions then could you try to remove the close line using // in both and try that. I will need to install cs5 on mac tonight. I appreciate the tests. I did say early days :)
Okay installing CS5 on a Macbook now and will see if I can spot the issue. Wish me luck...
UPDATE : So CS5 hates close AND back the way I did it.. the hunt continues
Fixed,
I have had to change the way the script works right now. Its a 90% fix 10% workaround.
https://github.com/KevCJones/Photoshop-to-Corona-Exporter
Before the process to export a merged folder was to :
1. merge
2. select all + copy
3. new doc
4. paste
5. save png
6. close (CS5 hates)
7 undo merge (CS5 hates)
BUT CS5 didn't like close OR undo. Removing them, means your PSD remains beaten and there is a ton of untitled windows in PS. SO I have added a clean up function at the end which closes ALL open docs. Not perfect but managable if you know its going to happen.
Later I will add some tests to close all NEW documents which we're created since the export. For now though, could you test your end and tell me if it works. I did the export and ran in the simulator and it works well. I fear now, I need to test on windows again and CS4 and CS3. Although this method is a little simpler and more brutish so in Photoshop coding sense its probably safer :P
Test List open for anyone to assist:
CS5 Mac - PASSED EXPORT - PASSED SIMULATOR - ???? HARDWARE
CS4 Mac - ??
CS3 Mac - ??
CS5 Win -??
CS4 Win - ??
CS3 Win - ??
Thanks Franciso, being newer to Corona i hadn't grasped the difference between the newImage and newImageRect. i changed the exported to use the latter now so Retina display support is feasible.
I actually was thinking if there is a way I could build in an auto saving of the @x2 pngs as a feature of the the Exporter.
Thats me for the night now until the next bug (watch it be windows now), appreciation to the testers for today.
I'll retry again in the morning :) nearly midnight and need some sleep :)
SO testing updates showed me my changes to the script broke the windows export SO now i'm going to create two scripts for the moment Win and Mac and maintain them until I find an elegent way to split operations inside like if(WIN)//do win solution etc... will upload the two scripts now hopefully... if GIT lets me.. (the git)
New Scripts : https://github.com/KevCJones/Photoshop-to-Corona-Exporter/tree/master/src
Just test for you platform...
Exported Using | PASS or FAIL
Win CS5 | PASS
Win CS4 | PASS
Mac CS5 | PASS
That being said, I have concerns that long directory names and also system ability to keep up with the large number of operations might be causing crashes so I might do a staged exporting with more alerts to let Photoshop catch its breath.
Merged back into one script...sorry if anyone downloaded the intermediate scripts... don't suppose anyone here has tested either the MAC script or this one on there machines?
Just tried the script on Mac CS5, it crashes Photoshop, I can send you a copy of the error display, plus it launches the script editor when it runs.
him at kevincjones dot co dot uk - the weird part is i've ran it on my MAC OSX with CS5 so its a spot the difference.
Spot the difference time.
I wonder if its directory length (too long maybe PS doesn't like) for a controlled test could you try to run the PSD in a shallow folder called test on the desktop.
Another thought is that it perhaps the Mac OS version? I'm running Snow Leopard on a mac book mini? You?
Not sure what it is that makes it run the script editor but thats not a bad thing. When you run the script it outputs trace messages in the console. I will need to put some more error logging in me thinks..
First let me say, I am so glad you are making this tool. I have tried running it from the root folder, the user folder, and the desktop. I am running a 27inch iMac, Snow Leopard, I have another machine I will try it on to make sure there is not an Adobe configuration issue with this machine. I am using the test.psd file from the latest github package
here is the info from the console, where it stops
Starting the export using version 0.0.38
SCENE - scene1
MERGEDGROUP :scene1->backgroundimg.png
Saving Merged Layer
ArtLayer
Thanks for the support... Photoshop is a weird pedantic child that spits its dummy out a lot it seems :) but we will get there in the end.
I'm going to upload a new script in 5 minutes with a few additions.
try catch block on the main script to see if we can catch it before a full on meltdown.
and a variable or two to turn on/off stages of the process to pinpoint the line it hates.
Your system seems far more spec'd than mine. So not too slow, too fast? :P 5 mins.
New script it up... now i hope the try catch error will stop it from crashing but since I can't recreate the error at the moment I can't tell.
The output console should offer up a version and OS as the first line. I'd like to know what yours says, my OS split might be broke if e.g. yours says Windows... =/
If it fails try again but with
1
| var renderImages = false; // turns off image rendering |
I have recreated on windows :o with this new try catch its giving me better readouts.. I am going to create a branched version to test with.. when I have a new simpler export version working I will go and try it on the mac too. If CS5 mac and CS3 Windows work I will share...
PS Im also looking at creating a UI panel for this too in the future. Add cool export goodness with progress bars (gasp)...
https://github.com/KevCJones/Photoshop-to-Corona-Exporter/tree/master/src
Please try the CoronaDirectorExporter_newMerge.jsx
I've tried two things.
1. I saw that the export selected layer by name BUT if we had another layer of the same name it would skip to it, this would then fry it in the event that it was a group not a layer... fixed by creating a temp name per layer while exporting and returning it to normal afterwards.
2. I now merge via a different JSX call and call the same save function. Less code and works just the same.
I'm not going to say @.@ its fixed - again.. but it did work on my WIN CS3 and MAC CS5 now.
I will jump for joy if someone manages to get an export. Nothing yet though makes me understand why my machine loves it and others still get hate from it.. if this works I will merge remove the old one and rename this temp testing version.
Hello!
I just tried on an iMac with Snow Leopard with CS5 and it crashes. This are the messages at the consola:
Starting the export using version 0.0.39
Windows
Create folders...
SCENE - scene1
MERGEDGROUP :scene1->backgroundimg.png
temp layer name is 1301588153272
Saving Merged Layer
But runs fine on windows 7 with CS5
Thanks a lot for your job!
Woohoo at least Windows works..... did I mention I'm not actually a lover of macs ;) despite the name.
Spot the difference again, from logs its still something in png save so will add more traces to each step.
Mines an Intel Mac don't suppose thats the difference ? Or that I think I use.extended PS versions on all?
If I have time tonight another build attempt to fix... I'm busy from then till Sunday. If your Windows users, take this version and test it on Android devices for me. ;)
So not much of an update for Mac users i'm afraid. I have added more traces in an effort to spot your own offending code.
https://github.com/KevCJones/Photoshop-to-Corona-Exporter/blob/master/src/CoronaDirectorExporter_newMerge.jsx
It still works on this machine which is running Photoshop v12.0 Extended running on
Model Name : MacBook
Model Identifier: MacBook4,1
Processor Name: Intel Core 2 Duo
Processor Speed: 2.4 GHz
Mac OSX 10.6.6 Build 10J567
I did have one crash randomly and I ran the script again by mistake straight away and it worked from there on out... don't know why. Will run on a couple of Mac's at work and see if any others have varying results... with luck one will...
Updated again - last try until Sunday..
https://github.com/KevCJones/Photoshop-to-Corona-Exporter/blob/master/src/CoronaDirectorExporter_newMerge.jsx
I've removed a lot of code from the auto generator (scriptListener) for PS. Now only use about 3 bits from it.
I will test still tomorrow at work and see if I did it...
Did anyone get a chance to test this on their Mac OSX CS? Still getting successful exports fo myself but would like to try and fix it for anyone whose having trouble.
Cheers
I tried both of the scripts on OSX CS5. The exporter script crashed photoshop almost immediately each time. The new_merge version got considerably further before crashing. I had the Sam experience on Photoshop CS5 on Windows 7 running in parallels. I think the issues is still a Mac issue
UPDATE: Tried the non Merge script just now and it completed succesfully, the Merge script did produce an error!
Tried to export the test.psd again and it crashed photoshop, I didn't do anything differently
@TechnicalSamuraiMac: Yes, exporter now works in CS5 Mac!
However the demo PSD exports fine but the simulator complains of director being missing...
@CL-Apps - Yeah i don't generate Director or UI, if you look in the CPM folder i put up you will see the versions I used, when I update to newer versions of each I will put them in there again.
So hard to fix a script that breaks on some and not on others :/
@Runseld - I had hoped the merge would be the fix all script as my latest one. If you are running the extender to run the script could you possible paste the console output (top right panel) to a post so I could inspect it cheers.
TS
UPDATE: Just exported again and although the exporter complained of files being 'unavailable' I have managed to export a couple of times.
After throwing director.lua, ui.lua and some build settings that set the screen to landscape the demo PSD worked! and the clickable button worked.
Update: Mixed results - First run of Exporter ran without a hitch.
Second Run - errored out with the following message
Starting the export using version 0.0.39
Windows
Create folders...
SCENE - scene1
MERGEDGROUP :scene1->backgroundimg.png
Saving Merged Layer
ArtLayer
Exproter_newMerge results as follows
Error with following output
Starting the export using version 0.0.391
Windows
Create folders...
SCENE - scene1
MERGEDGROUP :scene1->backgroundimg.png
temp layer name is 1301921755483
-- Called savePNGLayer --
--Select the layer by name --1301921755483
--Creating a new document of width and height 480 320
--Pasting the copied clipboard data--
--Resizing the canvas to add padding--
--Save the image as a PNG --~/Desktop/export/images/backgroundimg.png
--Add the file to the close list--
SCENEIMAGE:scene1->title.png
temp layer name is 1301921757465
-- Called savePNGLayer --
--Select the layer by name --1301921757465
--Creating a new document of width and height 368 15
--Pasting the copied clipboard data--
--Resizing the canvas to add padding--
--Save the image as a PNG --~/Desktop/export/images/title.png
--Add the file to the close list--
SCENEIMAGE:scene1->textbody.png
temp layer name is 1301921758486
-- Called savePNGLayer --
--Select the layer by name --1301921758486
--Creating a new document of width and height 271 229
--Pasting the copied clipboard data--
--Resizing the canvas to add padding--
--Save the image as a PNG --~/Desktop/export/images/textbody.png
--Add the file to the close list--
BUTTONGROUP:scene1->test_1_
temp layer name is 1301921759655
-- Called savePNGLayer --
--Select the layer by name --1301921759655
--Creating a new document of width and height 146 35
--Pasting the copied clipboard data--
--Resizing the canvas to add padding--
--Save the image as a PNG --~/Desktop/export/images/exampleBut_touch_.png
--Add the file to the close list--
temp layer name is 1301921760442
-- Called savePNGLayer --
--Select the layer by name --1301921760442
--Creating a new document of width and height 146 35
--Pasting the copied clipboard data--
--Resizing the canvas to add padding--
--Save the image as a PNG --~/Desktop/export/images/exampleBut_default_.png
--Add the file to the close list--
Your file was saved at ~/Desktop/export/scene1.lua
SCENE - scene2
SCENEIMAGE:scene2->Layer1.png
temp layer name is 1301921761257
-- Called savePNGLayer --
--Select the layer by name --1301921761257
--Creating a new document of width and height 480 320
--Pasting the copied clipboard data--
--Resizing the canvas to add padding--
--Save the image as a PNG --~/Desktop/export/images/Layer1.png
--Add the file to the close list--
BUTTONGROUP:scene2->test_2_
1
temp layer name is 1301921763609
-- Called savePNGLayer --
--Select the layer by name --1301921763609
--Creating a new document of width and height 146 35
--Pasting the copied clipboard data--
--Resizing the canvas to add padding--
--Save the image as a PNG --~/Desktop/export/images/exampleBut_touch__1_.png
--Add the file to the close list--
1
temp layer name is 1301921765058
-- Called savePNGLayer --
--Select the layer by name --1301921765058
--Creating a new document of width and height 146 35
--Pasting the copied clipboard data--
--Resizing the canvas to add padding--
--Save the image as a PNG --~/Desktop/export/images/exampleBut_default__1_.png
--Add the file to the close list--
Sidenote - I am still very excited about this tool and really appreciate the amount of work you are putting in to its development
@Runseld - Im glad you are excited. looking at your log i think we're looking at a new issue here, this is crashing after the png exports and this time its probably crashing at the creation of the .lua files.
I'll add more traces tonight or tomorrow and let you know when the new version is ready to test, hopefully we can pinpoint which save it has a problem with.
I wonder IF you make a point of deleting the export folder and its contents and run again does it work again? Might be a write permissions setting on the OS?
Cheers
I was thinking something similar, It will run the test the first time in any folder, after which it will only create a main.lua file and the quit. If I delete the export folder it will either crash or just create a main.lua file. However, I have to restart Photoshop between runs or it will crash right away
Update, to get it to initialize the script I have to change the filename to something new each time. I have tried to find the cache in photoshop and delete, but I am not sure I even deleted the right cache file