How to get the enclosing folder of an Application?

Ok. re-visiting my Applescript to compare installed apps versus a list of predefined apps... here is my test code so far:
set appsPath to (path to applications folder)
tell application "Finder"
  set appList to name of every application file of entire contents of folder appsPath
end tell
set theApps to {"iMovie.app", "Microsoft Excel", "Microsoft Excel.app", "Adobe Acrobat 7.0 Professional.app", "Adobe After Effects CS4.app", "ColorEyes Display Pro.app", "Corel Painter X.app", "DiskTracker 2.3.2", "EPSON Scan.app", "Flash 8.app", "Product Ingest.app", "Product Tag.app", "Art Ingest.app", "TextWrangler.app", "Toast Titanium.app", "Suitcase Fusion 2.app", "Suitcase Fusion 3.app", "Fetch.app"}
repeat with anApp in theApps
  set vers to version of (application anApp)
  -- get parent path of anApp!!!!
  if (parentFolder is equal to "Applications" or parentFolder is equal to "Utilities") then
  set parentFolder to ""
  end if
  display alert anApp & ": Version: " & vers & " " & parentFolder
end repeat
The only thing I'm stuck on is how to get the parent folder of anApp. Basically we use several versions of software here that are not easily identifiable by the version attribute. However their enclosing folder has all the versioning info I need (e.g.: MS Excel 04's vers would be 110113, but the enclosing folder is "Microsoft Office 2004", and some departments get Office 2008, Office 2011, etc., so I need a human-friendly way to get the right versions)
I don't know if the "if" statement to check whether the parent is Applications or Utilities is correct as I haven't gotten that far in testing. I'm only interested in getting the parent of apps that have parent folder that is a sub-folder of Applications or Utilities.
Basically what I am trying to do here is write a text file containing all departmental apps, homefolder sizes, relevant partition sizes, etc. and spit it out at the tech responsible for migrating a user to a new mac (display alert is just convenient for testing purposes). In the past we've had too many "missed" items in QC like wrong apps installed, or wrong versions, or data not copied over properly, etc. So this way they can run this on the old system beforehand and the new system after, line everything up and check off if it matches. This is just a snippet...
TIA!
Andrew

Hi,
Andrew Caldwell wrote:
Is there a way to invoke these without the script opening each one?
You must use the bundle identifier instead of the name
Here a example :
set theApps to {"com.microsoft.excel", "com.adobe.Acrobat.Pro", "com.barebones.textwrangler", "com.roxio.Toast", "com.fetchsoftworks.Fetch"}
repeat with anApp in theApps
       tell application "Finder" to tell (application file id anApp)
              set vers to version
              set parentFolder to name of its container
       end tell
       if parentFolder is in {"Applications", "Utilities"} then set parentFolder to ""
       display alert anApp & ": Version: " & vers & " " & parentFolder
end repeat

Similar Messages

  • How to get the system32 folder path in java?

    how to get the system32 folder path in windows using java code?

    Zstar Electronic Co.Ltd, Wholesaler of fire cards for DS/NDSL/NDSi, Provide R4, R4i, DStt, iEDGE, AK2i,M3,M3i,N5
    www.zstar.hk

  • How to get the current path of my application in java ?

    how to get the current path of my application in java ?
    thanks

    To get the path where your application has been installed you have to do the following:
    have a class called "what_ever" in the folder.
    then you do a litte:
    String path=
    what_ever.class.getRessource("what_ever.class").toString()
    That get you a string like:
    file:/C:/Program Files/Cool_program/what_ever.class
    Then you process the result a little to remove anything you don't want:
    path=path.substring(path.indexOf('/')+1),path.lastIndexOf('/'))
    //Might be a little error here but you should find out //quickly if it's the case
    And here you go, you have a nice
    C:/Program Files/Cool_program
    which is the path to your application.
    Hooray

  • How to get the personal folder size

    Hi,
    I'm trying to develop a method for define the maximum size of personal documents folder. I'm changing the Upload Command, and I want to know if its possible to get the current size of the personal documents folder for the user that is trying to upload the document.
    For this moment, I've got the current UserID, and I have created an RID with the path "userhome/UserID/Personal Documents", but now I don't know how to get the size of this folder!!!!
    Thanks to all.
    Arnau Rovira

    Originally Posted by NanLau
    Hi,
    Does anyone know how to get the current size of Mailbox and Archive by using GW api?
    Can anyone answer this? Thanks.

  • How I get the community Folder of community using adaptive tag?

    Hi,
    How I will get the community Folder of community using adaptive tag.

    Hi,
    Andrew Caldwell wrote:
    Is there a way to invoke these without the script opening each one?
    You must use the bundle identifier instead of the name
    Here a example :
    set theApps to {"com.microsoft.excel", "com.adobe.Acrobat.Pro", "com.barebones.textwrangler", "com.roxio.Toast", "com.fetchsoftworks.Fetch"}
    repeat with anApp in theApps
           tell application "Finder" to tell (application file id anApp)
                  set vers to version
                  set parentFolder to name of its container
           end tell
           if parentFolder is in {"Applications", "Utilities"} then set parentFolder to ""
           display alert anApp & ": Version: " & vers & " " & parentFolder
    end repeat

  • How to get the frame rate of my application

    Hi again...
    How can I get the frame rate of my application?
    I also want the frame rate value to be the title of the frame, updated every second. How do I do that?
    thanks in advance...

    To get the path where your application has been installed you have to do the following:
    have a class called "what_ever" in the folder.
    then you do a litte:
    String path=
    what_ever.class.getRessource("what_ever.class").toString()
    That get you a string like:
    file:/C:/Program Files/Cool_program/what_ever.class
    Then you process the result a little to remove anything you don't want:
    path=path.substring(path.indexOf('/')+1),path.lastIndexOf('/'))
    //Might be a little error here but you should find out //quickly if it's the case
    And here you go, you have a nice
    C:/Program Files/Cool_program
    which is the path to your application.
    Hooray

  • How to get the iphone serial number  in application?

    hello,  everyone
       i  really want to konw how to get the iphone serial number in aplication ?  As it's different from uniqueIdentifier ....
    thank you

    Michele is correct - sneep will help you get the serial from the running domain on the M3000 ,
    and it is a good idea to install STB on your machines.
    If that isn't possible for you, then sneep can be downloaded directly from [http://www.sun.com/sneep]
    I believe that on this platform, sneep gets the serial from the output of prtconf.
    There is a minor correction to be made :
    After installed SNEEP use "man sneep" for all technical details.The sneep man page is not linked into the shared man pages, so you need to use
    man -M /opt/SUNWsneep/man sneep
    with out going to OK prompt (Banner)It is worth noting that the serial shown in the OBP banner is not the product serial
    that you will find on the physical serial tag.
    The banner "serial" is the decimal equivalent of the host ID, which you normally get in hexadecimal from the "hostid" command.

  • Anyone know how to get the downloads folder icon to appear in the dock?

    I accidentally dragged the downloads icon out of the dock and I can't figure out how to get it back there. Any suggestions? thanks!

    Sometimes you have to be a bit "forceful" with your drag, especially if the Dock is at the bottom--almost as if you are dragging the folder thru the Dock and off the bottom edge of the monitor.
    Francine
    Francine
    Schwieder

  • How to get the file path in adf application

    hii all,
    i have a txt file that i am using in my adf application,
    i am passing this txt file through a File Reader, for which i have to mention the file path.
    The file is in web-content and when i am hard coding the complete file path i.e C:/JDeveloper/myApp/ViewController/public_html/log.txt
    the application is working fine when run on integrated weblogic server.
    My requirement is to access this file without giving the static file path, as in case i have to use this application on any other machine..
    for that how to mention the file path-
    i tried using FacesContext to get the context path :-
    FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath();
    which gives me
    \myApp-ViewController-context-root
    after appending public_html\log.txt
    I am using the following path to access the file :-
    \myApp-ViewController-context-root\public_html\log.txt
    again i am getting the java.io.FileNotFoundException
    Does anyone know how to use file from inside the web-content without giving the complete path..???
    Thanks

    Hi,
    If you put your file under public_html folder, you can use this code to access the file:
    For example file is : log.txt
    FacesContext.getCurrentInstance().getExternalContext().getRealPath('/log.txt').toString().trim();
    Thanks.
    - LSR

  • URGENT: how to get the database error message into application?

    Hi, pls give some idea:
    For example, the database is MS Access. When insertion failed, the getMessage() method of SQLException will print "General error", while the log file created by ODBC will be "[MICROSOFT][ODBC DRIVER]column ID no found in student table"(...just a example).
    So, how to get this message in our application?

    instead of using the getMessage method, have you tried something like this:
             try {
             } catch (Throwable t1) {
                System.out.println(t1.toString());
             }If that still doesn't work, you can always redirect the log entries into a textarea but then everything that appears in the log file will be redirected!
    ;o)
    V.V.

  • How to get the Thread in another running application??

    Hi,
    If I have a java application running (as daemon), how can I get the running thread context from another new started java application?
    What I'm trying to accomplish here is that, after I started a daemon thread ( a ServerSocket program ), I want to write another program to control the running thread ( query the status, stop it, or restart it ...).
    Any help will be highly appreciated! Thanks.

    A different java application runs in a different Processand they cannot share anything.
    Any lucky out there? Anyone tried something on this?

  • How to get the current path in an application?

    i don't mean in the applet, i know i can use getCode() there, but how can i do the same thing in an application?
    should i use ClassLoader.getResource(String)? but i don't know how to use it, what does the parameter String mean?

    Start reading here:
    http://java.sun.com/j2se/1.4.1/docs/api/index.html
    Try looking at classes in the java.io.* package. You will probably be interested in things like Reader, InputStreamReader, BufferedReader. Other classes which might be helpful are:
    java.lang.StringBuffer
    java.net.URL
    All of these things are documented at the above link -- it's an invaluable resource. If you find things you don't understand about these classes, then consult your book, search the internet, and search this forum. If none of that helps, THEN post a specific question to this forum (and no sooner).

  • How to get the list of file from application server

    Hi Expert.
    I want to get the file list from dicrectory in application server
    best regards.
    Alex

    Hi.
    Yes, You are right, i can get the file list by AL11.
    But i need get the list in ABAP program.
    So i need a function modul to get the list. If you has some sample code, it should be very nice.
    Best.
    Alex

  • How do you get the Event folder date to match the media dates in FCPX

    Modifying the clip date/time with the Modify command works fine ... but the Event itself still has the date the event was created, not the date of the media that it contains.
    If tried using Touch on the Event folder but FCPX ignores it.
    Any ideas on how to get the Event folder date to match the media dates (or set to any other date desired) so that Events sorted by date show the actual dates of the media that they contain?
    Thanks
    Jonathan

    Here is the texture I've been manipulating  all afternoon to try and achieve the looks i want.
    and when I put this texture over the top of other images and select Multiply, and adjusted the opacity, this is what i get....
    Now this kinda works?? but it still looks not as good on an asian person.
    Thanks by the way to everyone for all the tips, I really really appriciate it   and more suggestions for improvments are welcome!

  • How to get crawler destination folder path through api

    with following code i am getting crawler folder source path
    com.plumtree.openfoundation.util.IXPPropertyBag propertyBag = oPTCrawler.GetStartLocation();
                   String oldFolder = propertyBag.ReadAsString("PTC_UNIQUE");
    how to get the destination folder path ?
    any help appreciated

    i would like to get the values from PT_TAX_DESTFOLDERS
    <A N="PT_TAX_DESTFOLDERS"><I N="DIMS">1</I><I N="MAX0">0</I><I N="0">1324</I></A>
    1324 being the folder id
    when trying
    com.plumtree.openfoundation.util.IXPPropertyBag propertyBag = oPTCrawler.GetStartLocation();
                   Object[][] propertyBags = (Object[][])propertyBag.ReadAsObject1DArray("PT_TAX_DESTFOLDERS");
    i am getting null

Maybe you are looking for

  • Error while sending transaction

    Hi All, We are facing below error while sending transactions, We are able to send successfully OAGIS file to supplier using custom documnet over internet, but in the reports after couple of sceond it showing one blank error. EX: Machine Info: (usstlz

  • Problem with purchasing from itunes

    Has anyone encountered a problem when purchasing a song on credit. I have an account with credit and get a message a valid address is necessary to purchase using store credit. I don't understand I just downloaded on Tuesday and now can't get anything

  • Single Tabular structure of boxes for more than one form?

    Hey everone !   Can i use a Single Tabular structure for more than one form ? Coz i need the same structure for all my forms and its getting really tough to create it for each and every form ?

  • Different "access-list outside_cryptomap" for every VPN?

    Hi, Just for my understanding. I have one VPN connected to my Cisco ASA 5520, when I tried to add another VPN the I have to create a 2nd cryptomap, can I not create a group so there is one crypto map? Currently I have: access-list outside_cryptomap_1

  • How Can You Find Out Cell Dimensions in DWcs5

    Hi, I can't  figure out how you can see the hight and width of cells in Dreamweaver Cs5, when you put the curser in a cell it some times displays either the hight or width in the property inspector, sometimes you can figure it out from the hight or w