Jump to content

Reading iphone app files


Recommended Posts

Not wrong place, this script is running on windows, not a mac, maybe my question has been misunderstood...

Im trying to develop an autoit script to read certain lines out of a .plist file (example attached (just change .txt to ,plist, it wouldnt let me upload it as .plist)

so for example I want it to read the value in .plist for CFBundleDisplayName and put it into a variable for me to put into a label

example.txt

Link to comment
Share on other sites

  • Moderators

If you have an application set up to open that file type, you should be able to just use a FileReadToArray on it, like so:

#include <Array.au3>

$sFile = @DesktopDir & "\example.plist"
$aArray = FileReadToArray($sFile)

    For $aLine In $aArray
        If StringInStr($aLine, "CFBundleDisplayName") Then
            ;Do Stuff here
        EndIf
    Next
Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

And all post #4 did was find it, moving to the next line and replacing the text you want goes in the "do stuff here" part.  This is the portion of the exercise where you get to try something for yourself, and post your result, as it has become a simple string operation.  Filereadtoarray puts you like 80% of the way of there.

And post #5 should have been the first question you asked as nothing else has been pertinent.

Edited by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

  • Moderators

boththose is quite correct, you have been provided a great hint, now it is time to show some effort.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

I was expecting to use XMLDomWrapper, not put it into an array, which is why I questioned the answer from you guys

So far ive got the following but its giving me -1 return rather than the value of the first key

#include <_XMLDomWrapper.au3>

 

$sFile = @DesktopDir & "\example.txt"



    _XMLFileOpen($sFile)
    $aNodes = _XMLGetValue("/plist/dict/key[@key=CFBundleDisplayName]/string")

    
                MsgBox(0, $sFile, $aNodes)
Edited by cookiemonster
Link to comment
Share on other sites

  • Moderators

Once again, information that would have been useful at the outset ;)

 

I was expecting to use XMLDomWrapper, not put it into an array

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

A real quick way to get your problem ignored, is to ignore the solutions provided.   My suggestion would be to go to post #4, create a working model with filereadtoarray.

Then maybe go google about your new problem:  http://cakoose.com/wiki/plist_xml_is_pointless

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...