Jolly Roger <(E-Mail Removed)> wrote:
> In article
> <Patrick.Stadelmann-(E-Mail Removed)>,
> Patrick Stadelmann <(E-Mail Removed)> wrote:
>
> > In article <1k5fl11.147or4a1cxaikgN%(E-Mail Removed) r>,
> > (E-Mail Removed) (pierre lemercier) wrote:
> >
> > > But my file (let me called it xxx.ipa) is not a text file; it's a rather
> > > complex structure;
> > > - it's a zip archive
> > > - when dezipped it gives you a folder named xxx
> > > - Included in this folder is another unique folder names Payload
> > > - inside is an unique file called xxx; this file is an application whose
> > > content (lot of folders and files including the one I am interested
> > > in)can be accessed by right clicking it.
> > >
> > > All this has to be manually done and seems difficult to automatise.
> >
> > Not so much. You can use the "unzip" command to extract just the file
> > you want :
> >
> > unzip -j xxx.ipa Payload/xxx/Info.plist
> >
> > in the current directory (add -d <path> at the end to extract at <path>
> > instead).
> >
> > You can call the "unzip" command from AppleScript with "do shell script".
>
> It is precisely as Patrick says. You simply use the "do shell script"
> command to "unzip" the archive. From there, you can determine the full
> path to the expanded files, and pass that path to the AppleScript "open
> for access" and "read" commands as I outlined. It's actually much
> simpler than GUI scripting BBEdit, which adds another layer of
> complexity to the job.
Thanks for your answer that can give me a possible solution
my test file is oMaps 1.3.4.ipa
it is located in a folder named Essaizip on the desktop
Firstly I have tried to use various commands in terminal to see what
appends:
cd ~/Desktop/Essaizip to access the right dir >ok
unzip -j "oMaps 1.3.4.ipa" to try to unzip that file
>it ask me "replace CodeResources? [y]es, [n]o, [A]ll, [N]one,
[r]ename: my answer n
>it gives me a lot of files including Info.plist
unzip -j "oMaps 1.3.4.ipa" Payload/omaps/Info.plist
> give that answer
>Archive: oMaps 1.3.4.ipa
>caution: filename not matched: Payload/omaps/Info.plist
Secondly I have tried with "do shell script" but I am not sure of the
syntax
set p to POSIX path of "MBP-Sys:Users

ierrelemercier

esktop:Essaizip:"
set res to (do shell script "ls " & p)
display dialog res > files wich are in that directoty:
oMaps 1.3.4.ipa >original
oMaps 1.3.4.zip >.zip instead of .ipa
oMaps1.3.4.zip >without space
oMaps
Tried with do shell script "unzip oMaps 1.3.4.ipa
Payload/omaps/Info.plist"
> Error 9 >unzip: cannot find or open oMaps, oMaps.zip or oMaps.ZIP
Tried with do shell script "unzip " & "oMaps 1.3.4.ipa" & "
Payload/omaps/Info.plist"
> Error 9 >unzip: cannot find or open oMaps, oMaps.zip or oMaps.ZIP
Tried with do shell script "unzip oMaps Payload/omaps/Info.plist"
> Error 9 >unzip: cannot find or open oMaps, oMaps.zip or oMaps.ZIP
> may be a problem with space and dot inside the name?
Any advice?
PS: Sorry for my broken english and for not being used to manipulate
Terminal