Extract and Rename! from ipa file (iphone)

Hi all, i would like to extract the "iTunesArtwork" file from an ipa archive (so an zip archive) and rename it by the name of the archive and add .png at the end, i try but i still lame even i have a lot of sample from you guys since Dopus6 (Thanks to all !)
So i try and i do this:

Clipboard COPYNAMES=nopaths {file}
"C:\Program Files\7-Zip\7z.exe" x {file} iTunesArtwork
Select NONE
Rename iTunesArtwork iTunesArtwork.png
Rename iTunesArtwork.png FROMCLIPBOARD

But of course, it doesn't work at all, it still tried to rename the archive name and not the file extracted....pfff :slight_smile:

Thank you in advance to help me :slight_smile:

a nice Friday

If ipa file is a zip file, you can add .ipa to Zip Extensions in Opus Preferences/Zipe Files/Zip Extensions (DOpus 10) so you will be able to enter the archive just like any other zip files.
Once it is done, such button should do the trick

Copy "{f}\iTunesArtwork" to "{f|..}" WHENEXISTS=replace rename type=files "{f|..}iTunesArtwork" to "{o|ext=png}"
Anyway, it doesn't work if you select more than one ipa file since the extracted "iTunesArtwork" file use the same name for all ipa files.

Maybe someone else could give you a better solution.

oops, this one is enough

Copy "{f}\iTunesArtwork" to "{f|..}" WHENEXISTS=replace rename type=files iTunesArtwork to "{o|ext=png}"

Yeah thank you kakartha ! it works great ! and as i see you code, i was far away !
With this command; work will be easy, thank you again to spend time on my trouble :slight_smile:

have a nice night !

ARgh! i talked to quicly, when i selected more ipa 's files, it only work on the first file, so i can't do a batch, a idea ?

As I have said, it works for one file at a time :wink:

Anyway, if you have too many files, you can do it in more than one step:

1- after you selected all ipa files, this button will send them in separate sub folder using their respective ipa name and it will extract the "iTunesArtwork" file.

@nofilenamequoting Copy MOVE HERE CREATEFOLDER "{f|noext}" Copy "{f|noext}\{o}\iTunesArtwork" to "{f|noext}" WHENEXISTS=replace

2- Once it is done, you can use the flat view and select manually all "iTunesArtwork" files and you can use this button which will rename the selected files using their parent folder name (which is using the ipa name)

Rename FILEINFO REGEXP PATTERN "(.*)" TO "{parent}.png"

3- deactivate flat view and if you want, you can move back your files where they were before using this button after selecting all folders:

@dirsonly @nofilenamequoting Copy MOVE FILE "{f}\*" HERE

The whole process is not as elegant than using a button doing it in one step but I am unable to find a way to make opus moves and renames multiples files using their respective parent's name in one step/button.

Note: {f}={filepath$} and {o}={file$}

Hi kakartha, Sorry i have missing your warning about just one file only :slight_smile:

Maybe it's not elegant like you said but all steps you made are intresting for to learn, it's better to have a lot samples than an Docs with my English (little rusty on the sides :wink:

I want to say thank you very much for all the work you 've done, It's true that i still would like a single function to do it, but, the better solution that i 've got for the moment is your first, maybe it works with only one selected files but i can map a shortkey on this function and use down arrow and this shortkey but your other samples can be useful ! (twice time :slight_smile:

Thanks kakartha !

I would have thought you should be able to do what you want to do with a single Copy command like:

@nofilenamequoting Copy FILE "{f}\iTunesArtwork" HERE AS="{o|ext=png}"
But... for some reason, specifying the AS= option with an explicit name ({o|noext}.png) is still resulting in Opus prompting you for the new name of the copied file - whereas it should normally just use the name you're providing along with the option. Seems like a bug to me (I'll submit a bug report), which only happens when the source file is a file within a selected ZIP file... for instance... this same command works like I would expect if the item you've selected is a regular FOLDER (say the IPA file itself extracted to a real folder).

At any rate, another way of going about this could be to modify the use of kakartha's helpful suggestions by moving the actual copy/rename commands into a User Command and then call that new user command from a toolbar button using the old dopusrt /cmd trick in order to process multiple selected IPA files individually... For example, you can extract the CopyIPAArtwork.ouc file from the attached zip file to the /dopusdata\UserCommands directory... and then paste the following button to your toolbar:

<?xml version="1.0"?> <button backcol="none" display="both" textcol="none"> <label>Test Button</label> <icon1>#pathfield</icon1> <function type="normal"> <instruction>@nofilenamequoting</instruction> <instruction>dopusrt /cmd CopyIPAArtwork &quot;{f}&quot; &quot;{o|ext=png}&quot;</instruction> </function> </button>
CopyIPAArtwork.zip (417 Bytes)

@y0y0gigi
you're welcome
yes, this forum is great for learning! :smiley:

[quote="steje"]But... for some reason, specifying the AS= option with an explicit name ({o|noext}.png) is still resulting in Opus prompting you for the new name of the copied file - whereas it should normally just use the name you're providing along with the option. Seems like a bug to me (I'll submit a bug report), which only happens when the source file is a file within a selected ZIP file... for instance... this same command works like I would expect if the item you've selected is a regular FOLDER (say the IPA file itself extracted to a real folder).[/quote]In fact I thought it was another limitation with zip files just like the "createfolder" argument which is not able to use a path (just like normal folder) as compressed folder name.

I tried your suggestion and I didn't know about user command and dopusrt! That's really interesting even if I don't know now how I will use that in future, thanks steje :slight_smile:
Anyway, it didn't work in a first place till I realize it was made for dual lister where there is a source and a destination. Now it works like a charm!

Hmmm... if you used the actual user command I included in the zip - it should work fine in a single file display lister... no need to put it in dual-display mode or have a source and dest lister. At least... works fine here anyway. The user command includes the "HERE" option in the copy command so as not to need a "destination" lister.

I don't know what happened but I posted after trying one, two time, opening command and closing it and I tried again and again an error message...now it works everytime just as you said!
I suspect my Opus is occasionally haunted lol

hi

first of all I want to thank all those people who helped here

Is there a way to extract iTunesArtwork@2x.png from multiple .IPA files?