How do I filter by file type in Applescript?

Hi
I have put together this AppleScript which opens the folder of the currently playing track in iTunes in icon view. The one thing I'd like to do which I can't work out is to filter by file type. I'd like to just have images/jpgs show in the resulting finder window. Could someone help me out with this?
Thanks
Nick
tell application "iTunes"
if player state is not stopped and class of current track is file track then
set loc to location of current track
tell application "Finder"
reveal loc
activate
set curFolder to (Finder window 1)
set bounds of Finder window 1 to {50, 30, 1870, 1140}
tell curFolder
set current view to icon view
set arrangement of its icon view options to arranged by name
set icon size of its icon view options to 290
end tell
end tell
end if
end tell

OK. Thanks. I can live with finding the JPGs myself. Because they are usually the first files listed when sorted by filename, is there a way of getting the finder window to scroll to the top with Applescript. With the current script it is scrolling to where the currently playing file is.

Similar Messages

  • How to filter the file type and size when uploadind files into APEX

    Hi,
    I was wondering how I can do to validate the size of a file, before moving it to my table ? I'd like to filter the file type, but for this one, I think I can use regular expressions in a validation process.
    I don't know if there is a way to read the file size even before sending it into the temporary file table.
    Thank you
    Leinad

    Hello Leinad,
    AFAIK, you have to create an APEX validation (PL/SQL returns Boolean or Returns error text), which will query the file details from apex_flow_files table. Here you can get filetype and size etc.
    So just validate and if any validation fails, then delete the file from apex_flow_files and riase error message.
    Regards,
    Hari
    P.S. Please note that, if there are other apex validations on your page and if they fail, still apex will load the file into apex_flow_files table. So it's good idea to create a validation (PL/SQL) which will fire (condition) when inline validation errors occured. Make sure that this is the LAST validation on your page in sequence. And here you can write code to delete the file from apex_flow_files table.
    Edited by: Hari_639 on Sep 20, 2012 10:09 PM

  • Mailexample.sql how do you determine the file type?

    I'm using the mailexample.sql which explains how to use the demo_mail wrapper package for utl_smtp. There's a procedure for attaching text files and a procedure for attaching binary files. I've got binary files to attach to email successfully.
    How can I determine the file type so that I can use the attach_text procedure when attaching text files rather than the procedure for attaching binary files?
    Sandy

    Watch out! I think there is a bug in that code :-
    bug with PL/SQL Sample - maildemo.sql
    To answer your question - the usual way of determining a file type is to look for 'magic numbers' in the file that indicate its type. For example, Windows exe files often (always?) begin with the two letters 'MZ'. Zip files begin with 'PK'; Rar archives begin with 'Rar!'. Text files can begin with anything, and do not have any characteristic marker, but USASCII7 (which is what the format that routine is designed for - I think), is a characterset that only uses the first 7 bits of the byte. You could read the file, and if you find any bytes > 127, then you know it is not a USASCII7 file. I have seen various programs that 'sample' the first 64 or 256 bytes of a file instead of reading the whole file, and they usually get it right.
    Hope this helps.
    Takmeister

  • How do I sort by file type?

    I was wondering how I can sort by file type?  I have a bunch of .moi and .mod files in a directory and want yo delete the .moi files.  If I could sort by type, then it would just be a matter of highlighting those and deleting. I tried sorting by kind, but since they are seen as Unix Executable files by the OS, it sorts them but not by .moi or .mod.  Thanks in advance for your help.
    MAC OS 10.6.8

    I don't believe you can sort by extension.  However, what you can do is to type .moi into the search field at the top of the Finder window where you see those files.  That will initially show all .moi files on your entire computer.  At the top of the displayed search results will the the text "Search:" followed by three choices.  "This Mac" should be selected, but the name of the folder you were looking in will be the second choice...  click that one.  That will cause the search results to contain only files from that folder, containing the text ".moi", which should be the ones you're interested in deleting.

  • Filter by file type

    I am looking for an ergonomic way to filter by file type in the library. I know about the technique of CTRL + clicking on the file type in the metadata browser or entering the file extension into the find palette. Both work, but are not as easy as the filter method in Bridge.
    Ideally I would like to be able to just click in the filter area of the bottom thumbnail window to turn "show raw" on or off.
    Tis a small thing, true enough, but it would be a nice touch.
    Rory

    Also the third listing down in Library Left Panel under Metadata Browser is "File Type".
    Don
    Don Ricklin, MacBook 1.83Ghz Duo 2 Core running 10.4.10 & Win XP, Pentax *ist D
    http://donricklin.blogspot.com/

  • How to add array of file types to file dialog box

    Hi
    I just want to know how to add array of file types in file dialog box vi. I know that multiple file type can be added to filedialog vi in the pattern Input string separated by semicolon (eg *.vi;*.doc;*.jpeg;*.xls). But i want file dialog which is shown in the below picture.
    I think that file dialog vi call user32.dll but i don't have that header file to call that dll.
    Waiting for your esteemed response.
    Thanks & Regards
    Samuel J
    System Engineer
    Captronic Systems Pvt Ltd
    Bangalore, India.

    I'm not sure how (or even if) it can be achieved using the LabVIEW built-in open dialog, but a .NET call to openfiledialog (http://msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx) can do what you're looking for. The .NET functions are better documentented that simple user.dll calls, so it might be easier to implement.
    Shaun

  • Ipad 4: how do I attach multiple file types to an email?

    Hello,
    I have seen multiple threads on this topic saying you can only do attachments in an email (other than photos or videos) by going to the app that holds the file and emailing it from there (ex: go to adobe reader or ibooks to email a PDF). This work around seemed sufficient for some people but I have need to attach a JPG, PDF and .doc to a single email. How do I do this within the ipad's built in email app? Is this impossible and if so are there other free email apps that someone can reccmmend?
    I find the ability to only email files from within its parent app to be cumbersome and not in keeping with Apple's style of making one's life easier and more efficient. In fact this seems woefully backward and goes back to the early days of computing. I get it that emailing from within a particular app is necessary but so is the ability to attach multiple file types from within the email app. :-(
    So frustrated!!

    The GoodReader App can manage files and create emails consisting of multiple files types.
    See here: https://itunes.apple.com/us/app/goodreader-4/id777310222?mt=8

  • Newbie stuck - how do I change the file type of a photo I am formatting from a TIFF to a JPG?

    I am new to Aperture and struggling to figure out some of the basics, even with the tutorials.  I need to submit a photo for an art competition - the master is a TIFF and I need a JPG under 1.8 MB - how do I change the new version's file type and keep it with the master?
    Thank you in advance.

    I can't recommend the method proposed by Carolyn Samit; in fact, I recommend ignoring it.
    Aperture is large, complex, and can take some time to learn to use.  It is also quite powerful, and can handle nearly all -- or all -- common tasks you throw at it.
    I have written a very short guide to Aperture which was intended to provide some firm footing for those getting started.  I humbly suggest that you start with a quick review.
    One of the things that presents a bit of disorientation for new users is that, in practice, Aperture keeps your pictures in a kind of limbo.  There are good reasons for this -- suffice it for now to accept that you import image-format digital files into Aperture, you use Aperture to organize and optimize these as Images, and then when need a file to use outside of Aperture, you export you Image.  It is at export that you format your Image: you select the file type, the compression amount, the file name, the file size, and more.
    In your case, then, you will export your Version, and set the file type to TIFF (recommended above JGP whenever quality is paramount). There is no way to know the file size in bytes prior to creating it.  Start with a full-size TIFF and, if necessary, knock it down by percentage until the exported file is less than 1.8 MB.
    There is no reason to attempt to keep this file with the Image in Aperture.  Send it on its way.  Any time you need another file from your Image, you can create it fresh via "File→Export→Version".
    HTH.  If it doesn't, ask more. 
    Message was edited by: Kirby Krieger -- expanded a bit.

  • How do i ADD a file type (such as Quicktime mov) that is NOT listed in the Content Type list?

    All the instructions I find when searching for how to ADD a file type just explain how to manage how Firefox handles that file type. And that is not possible when the file type is not in the list.

    Usually MOV is played by the QuickTime plugin. Some other plugins also may handle MOV. This is handled by entries in a hidden database, but you can view the contents if you type or paste about:plugins in the address bar and press Enter.
    In looking at your plugins list under "More System Details" I don't see QuickTime. Is it disabled (set to "never activate") on the Add-ons page? Missing?
    Tools menu > Add-ons > ''in the left column, click'' Plugins

  • How to rename "Kind" for file types

    In finder, "Kind" describes file type. With my defaults
    .doc kind is "Microsoft Word 97 - 2004 document"
    .xls kind is "Microsoft Excel 97-2004 workbook"
    .ppt kind is "Microsoft PowerPoint 97-2004 presentation"
    .pdf kind is "Portable Document Format (PDF)"
    and so forth.
    I wish to edit the string describing the file type.
    Where is this string stored? How can I edit it?
    I am not trying to change the associated application, just the description under "Kind" in Finder for that application, or for the file type if that's how it's stored.
    It was easy in Windows XP, surely there is a way in OS-X.
    Thank you.

    Good answer, Barney, it worked. Thank you.
    For anyone trying to do this, here's more exactly what I did to change the "Kind" description for ".doc" files:
    In Finder, Applications folder, Microsoft Office 2008 folder, control-click Microsoft Word.app, select "Show Package Contents". In Contents folder, select info.plist.
    Open info.plist using Property List Editor.app, available on the OS-X distribution disks in the developer section.
    Next to "Root", option-click the disclosure triangle to see all values.
    Scan the values, edit the values by clicking on them.
    Warning: follow these instructions at your own risk.

  • How to create a "Recent Files" type portlet?

    I have a request to create a "recent files" type portlet that would be specific to each user on our Intranet -- I'm guessing something similar to how MS Word's Recent Documents or IE's History works. Any ideas?

    The Recent Objects portlet includes only items that have been created/modified, so it's not suitable for users.
    I would like to add a portlet of recently viewed pages but am not sure how to proceed.
    Does anyone have any thoughts on this?

  • Lightroom Filter by File Type

    Is there a way to filter in the Library Module by file type.  For example if I just want to view .CRM files.

    In the library module select metadata at the top, you should see 3 columns. Click on the heading for one of the columns and select file type or click in the top right hand corner and select add column.

  • Spotlight: How to search for specific file types?

    Hi. I'm looking for bookmarks that may contain a particular word. Is there a way to filter my spotlight (or finder) searches just for a particular file type? I know you can sort results by file type, but it's rather just filter in the first place...

    Command F should do it. Once the search window appears, you should see a drop down box headed kind and next to it one headed any. Select PDF from the any one. Click the plus button, and another field will appear and you can see again more drop down boxes. You just want to set these up so you end up with name and contains, you can then add your text to the remaining field.
    Also see [this|http://apps.tempel.org/FindAnyFile/index.html]
    Message was edited by: gumsie

  • How to see all image file types when saving images without selecting "all files"

    Hallo, and thank you fom reading.
    I am a person who saves a lot of images online in different folders with different names like G - 456 or F - 35.
    I have been using firefox 10.0.2 for a long time because of a bug (I guess) that made it easier to save images.
    When I saved an image it would always show me all the image files in any folder I wanted to save it, and that way making it easier for me to save files with the right names.
    Now with the newer firefox (currently 19.0) whenever I try to save a JPEG I only see the JPEG files in the folder and only way to see the others is by selecting "save as type" all files, but with this I also see all the files that are not images.
    This used to save me a lot of trouble and a bit of time but I dont see anything in the options menu that can help me. Is there a way to recreate this function?
    Thank you for your time.

    I suspect this is a Windows problem. I am surmising the FilePicker uses the Operating System or Desktop facilities. Does Windows 7 offer any other file categories like ''images'' ?
    I do not normally use Windows 7, but may the option depend upon the directory being an indexed one, I ask after finding this thread ''Bring File types tab back'' [http://www.windows7taskforce.com/view/819]
    This question is a duplicate of [/questions/951764]
    Normally I would lock the duplicate question, but in this instance I will leave it open as it is unanswered and someone may give a better reply.

  • How to save as Excel file type?

    There were no Excel file type under the "Save As" function.  Is there anyway to include Excel file type under this list?  Snapshot attached. 
    Solved!
    Go to Solution.
    Attachments:
    Export_file_types.png ‏28 KB

    Hi NiCoder,
    You have a numer of different options to get data from the DIAdem Data Portal to Excel:
    1)  Save to TDM or TDMS file and use the free TDM Excel Importer to load the data into Excel
    2)  Save to CSV file and use Excel's built-in ASCII file import feature to load the data into Excel
    3)  Load the gfsexcel.dll GPI-DLL and use the "File >> Save as..." option to export an *.xls data file
    4)  Use a custom VBScript to automate any of the above 3 options
    5)  Use a custom VBScript to directly send each Data Portal data channel to a column of values in Excel via ActiveX
    Options 1) and 2) are easiest if you want a purely interactive solution.  Option 1) will export all the data values as well as all the properties.  Option 2) will export all the data values and the name of each channel in the Data Portal, but none of the other properties.  If you choose to use option 3), know ahead of time that this feature is limited to 255 columns and will not export any custom properties, just the properties that existed back in DIAdem 8.1.  Option 4) can add in all the custom properties that are missing in option 2).  Option 5) can export all the data and all custom properties, but it is also the slowest option and involves the most programming.
    Let me know what sounds best to you,
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

Maybe you are looking for

  • How to "In Effect" Turn Off Time Zone on iCal AND main computer

    I am hopeful that this will help those of us who don't want to have any form of Time Zone on our computers or iCal. I read some of the other posts and see that it does not appear an option to completely turn off all Time Zones on the computer and iCa

  • What's the best route to install Snow Leopard from 10.5.8

    I followed the instructions but the installation killed safari, my ethernet connection, my local apache and my mysql server. I don't know what else was killed when I installed snow leopard, but that was enough to make me decide to try restoring from

  • Messages not showing up in notification center

    I've had a problem for a while where iMessages and text messages are not showing up in the pull-down notification center. I have everything enabled in Notification settings, numerous restarts, toggled settings on and off... Nothing works. Anyone else

  • WBS elements display like CJ03

    Hello All,           I have to develop a screen similar to CJ03 where I have to display the WBS elements in the same way as they are displayed in TCODE. How to get the functionality of dropdown buttons in dialog programming? Is there any function mod

  • Where clause fails

    In my project I do a query using  the folloqinf statement : vPastiCDC totpasticdc_tab3_riga =                             db.vPastiCDC.Where(                                 x =>                                     x.CDC == Cdc_considerato && x.Anno