Is it possible to set a files label on opening via apple script?

Hi,
I would like to mark files which have been opened with i.e. a red lable.
Would that be possible using apple script?
If yes how would that script look like?
Thanks in advance.

I don;t know of anyway of doing this in Applescript. There is the ability to monitor files using launchd, WatchPaths,  but you need to know the files your monitoring before hand so it won't work for this.
Again if the domain is limited, that is it's only a certain application or a certain folder you're interested in it might be possible to put something together in Applescript but as a general use, system wide, solution I don;t think it can be done.
One other possibility would be to use the Finder and smart folders. You could look for all files in a certain folder or system wide that have been acessed in the past period and then mark those. Something along those lines is doable with eiter the Finder or a script.
regards

Similar Messages

  • How to set default file type for Open dialog

    Dear my friends,
    I am using "At selection-screen ON VALUE-REQUEST FOR filepath" to display open dialog and i want to set default file type for open dialog = *.txt.
    Thank your times !

    Hello,
    U can make use of this code:
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR SP_FILE.
      PERFORM SAVE_DIALOG CHANGING SP_FILE G_F_RC.
    FORM SAVE_DIALOG CHANGING PO_FILE PO_RC.
      DATA: L_VA_BOXTITLE     TYPE STRING,
            L_VA_DEFAULTFILE  TYPE STRING,
            L_VA_DEFAULTNAME  TYPE STRING,
            L_VA_DEFAULTPATH  TYPE STRING,
            L_VA_DEFAULTFULL  TYPE STRING,
            L_VA_FILTERTEXT   TYPE STRING,
            L_VA_CODE         TYPE I.
      CLEAR: PO_RC, G_F_CONF.
      L_VA_BOXTITLE   = TEXT-B01.
      L_VA_FILTERTEXT = TEXT-B02.
      IF PO_FILE IS INITIAL.
        CLEAR L_VA_DEFAULTFILE.
      ELSE.
        L_VA_DEFAULTFILE = PO_FILE.
      ENDIF.
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
        EXPORTING
          WINDOW_TITLE            = L_VA_BOXTITLE
          DEFAULT_EXTENSION       = 'TXT'
          DEFAULT_FILE_NAME       = L_VA_DEFAULTFILE
          FILE_FILTER             = L_VA_FILTERTEXT
          INITIAL_DIRECTORY       = 'C:SAPWorkdir'
        CHANGING
          FILENAME                = L_VA_DEFAULTNAME
          PATH                    = L_VA_DEFAULTPATH
          FULLPATH                = L_VA_DEFAULTFULL
          USER_ACTION             = L_VA_CODE
        EXCEPTIONS
          CNTL_ERROR              = 1
          ERROR_NO_GUI            = 2
          OTHERS                  = 3.
      IF SY-SUBRC <> 0.
        PERFORM CHECK_ERRORTYPE(Z48M_MATDATA_UP) CHANGING SY-MSGTY.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        CLEAR PO_FILE.
        EXIT.
      ENDIF.
      IF L_VA_CODE NE 0.
        MESSAGE S818(3F) WITH TEXT-011.
        CLEAR: PO_FILE, PO_RC.
        EXIT.
      ELSE.
        WRITE L_VA_DEFAULTFULL TO PO_FILE.
        G_F_CONF = G_C_XFELD.
      ENDIF.
    ENDFORM.                    " save_dialog
    If useful reward.
    Vasanth

  • Will EC support setting default file type and Open With from file menu?

    The default file types I can live without, but at least allow for Open With on right click from Windows Explorer.
    I currently have EC set in the Open With programs list, but EC does not comply for any files I opt to open it with (.css, .php, .html etc).
    EC open but not the file I choose.
    Also, even though the above use case is not ideal when if I do attempt an Open With when EC is already open, a new application session starts instead of attempting to open in the currently active app frame. It would be ideal to allow for single app frame, multiple files when Open With is employed.
    Darrell

    Hey Darrell,
    Thanks for the feedback. How Edge Code treats files is definitely something we know isn't ideal and it's something we're looking at fixing soon. There's currently a story on the Brackets backlog that adresses the Open With issue - https://trello.com/c/GhF1Bgf9
    And it based on howit ranks in that priority it looks like we could potentially take that into Edge Code over the next couple of months.
    This is definitely a feature that we think is important before we consider ourselves 1.0 so it's high priority.
    =Ryan
    [email protected]

  • Is it possible to set webapp item releaseDate when submitting via ajax?

    I've been trying to set the releaseDate of a webapp item when entering the item via ajax.  So far I have been unable to do so....is it possible?
    For the field name and date format I referenced the API docs.
    I've tried both releaseDate and ReleaseDate
    Here's the console of the variable before submission
    theItemName: Test
    strDate: 12/14/2014
    Here's the relevant submit code
              var testOpts = {
                    url: profileAction,
                    data: {
                        ItemName: theItemName,
                        releaseDate: strDate
                    type: "POST",
                    success: function(data, txt, jqXHR) {
                        console.log("submit success");
                    error: function(jqXHR, txt, error) {
                        console.log("submit error");
                        return false;
                $.ajax(testOpts)
    Anyone done this successfully?
    Thanks
    Dave

    Hi Dave,
    The date format specified in the parameters section was incorrect, I have fixed that and will push the update shortly. The correct date format is YYYY-MM-DD - sorry for the inconsistency.
    I have just re-tested the sample code here - Reference guide - Create web app item (that one had the correct format and it was working properly.
    Thanks and have a nice weekend,
    Mihai

  • How to get latest added file from a folder using apple script

    Hi..
    I am trying to get a latest added file from a folder..and for this i have below script
    tell application "Finder"
        set latestFile to item 1 of (sort (get files of (path to downloads folder)) by creation date) as alias
        set fileName to latestFile's name
    end tell
    By using this i am not able to get latest file because for some files the creation date is some older date so is there any way to get latest file based on "Date Added" column of a folder.

    If you don't mind using GUI Scripting (you must enable access for assistive devices in the Accessibility System Preference pane), the following script should give you a reference to the last item added to any folder. Admittedly not the most elegant solution, but it works, at least under OS X 10.8.2.
    set theFolder to choose folder
    tell application "Finder"
        activate
        set theFolderWindow to container window of theFolder
        set alreadyOpen to exists theFolderWindow
        tell theFolderWindow
            open
            set theInitialView to current view
            set current view to icon view
        end tell
    end tell
    tell application "System Events" to tell process "Finder"
        -- Arrange by None:
        set theInitialArrangement to name of menu item 1 of menu 1 of menu item "Arrange By" of menu 1 of menu bar item "View" of menu bar 1 whose value of attribute "AXMenuItemMarkChar" is "✓"
        keystroke "0" using {control down, command down}
        -- Sort by Date Added:
        set theInitialSortingOrder to name of menu item 1 of menu 1 of menu item "Sort By" of menu 1 of menu bar item "View" of menu bar 1 whose value of attribute "AXMenuItemMarkChar" is "✓"
        keystroke "4" using {control down, option down, command down}
        -- Get the name of the last item:
        set theItemName to name of image 1 of UI element 1 of last scroll area of splitter group 1 of (window 1 whose subrole is "AXStandardWindow")
        -- Restore the initial settings:
        click menu item theInitialSortingOrder of menu 1 of menu item "Sort By" of menu 1 of menu bar item "View" of menu bar 1
        click menu item theInitialArrangement of menu 1 of menu item "Arrange By" of menu 1 of menu bar item "View" of menu bar 1
    end tell
    tell application "Finder"
        set current view of theFolderWindow to theInitialView -- restore the initial view
        if not alreadyOpen then close theFolderWindow
        set theLastItem to item theItemName of theFolder
    end tell
    theLastItem
    Message was edited by: Pierre L.

  • Retrieve duration of sound files via Apple Script - System Events

    I need to get more details of my sound files into a FileMaker 10 Database as it is possible by using the FileMaker import function. There ist a complicated way by going first through iTunes and than to FileMaker. Now I found out, that part of the information displayed when pushing cmd+i can be retrieved with this:
    tell application "System Events"
    properties of file "/Volumes/MacHD/singsong.mp3"
    end tell.
    But duration, channels, bitrate are not accessible. Is this a general problem with metadata? May be if I got a hint how to retrieve meta-data from .jpg files I might be able to apply this also on .mp3

    Try the AppleScript forum under OS X Technologies.

  • Excel file can't open via email after upgrading to OSX 10.9.2

    After upgrading to OSX 10.9.2, my Excel files are not readable when sent by email. My version for Excel is 2008 for Mac V12.3.6.
    I have no trouble opening Excel on my computer but cannot seem to send Excel files via email.

    Thanks. Tried that and it works but I had found another alternative.
    Didn't realise but my Excel file had the extension missing even though it was saved as xlsx. To solve the problem, I just clicked on 'Append the File Extension' when I 'Saved As' and it worked. Thanks for the alternative help anyway.

  • EPUB file won't open in Apple iBooks

    Hi all!
    I'm creating ebooks for a client using InDesign CC and she reports that the most recent EPUB I've created for her won't open in iBooks. As I don't own a smartphone or tablet I can't error-test on my end, but if you can think of anything that would lead to this error please let me know! I can't think of anything I've done differently in creating the EPUB, so maybe it's an issue with a recent CC or iBooks update? Has anyone else had this problem recently? The other ebooks I've made for her open fine.
    Her report on what happened: "when I go to my downloads folder and double click the file -- it opens the book shelf in ibooks and shows that the file is there but it has no cover. When i double click the book the program doesnt do anything. it doesnt open."

    In your last post here, you also had the same problem with the cover, which I think was due to the CMYK mode settings. Now I have no idea if iBooks doesn't display cover images that are CMYK, but usually images should be RGB (or Grayscale) in EPUB in order for them to display in ADE and Nook.
    Are there any other problems in the EPUB, i.e. other than the cover?

  • TS2845 How to set airplay on ipad2 with tv via apple tv2

    Hi i would like to understand how to use airplay for trasfering rented movie on Ipad 2 on to my television
    Via appleTV 2?

    Both need to be on the same network, you need to enable airplay on ATV (via settings). Then you tap the airplay icon on iPad, select ATV and it will stream.
    See, for more info
    http://support.apple.com/kb/HT4437?viewlocale=en_US&locale=en_US

  • Is it possible to set firefox to recreate the daily bookmarkbackup (json) file each time it close as opposed to once a day ?

    From what I understand, Firefox create a daily backup of it's bookmarks in a .json file the first time it closes each day. We found that if a user has already closed Firefox in the present day (and the .json bookmarkbackup file is already created for the present day), it won't add to this file the bookmarks added later in the day at futures Firefox closes...
    So if, for example, places.sqlite gets corrupted later in the day, all new bookmarks added after the first close (and creation of original daily backup) of Firefox aren't backuped...
    Is there any way to set it so that each time it closes for the current day, it regenerate the daily backup of bookmarks with the lastest bookmarked pages?
    Thanks

    Note that a JSON backup is created when you start Firefox and not when you close Firefox.
    You can make Firefox create an automatic HTML backup (bookmarks.html) when you exit Firefox if you set the browser.bookmarks.autoExportHTML pref to true on the about:config page.
    * http://kb.mozillazine.org/browser.bookmarks.autoExportHTML
    That backup is created by default in the profile folder as bookmarks.html, but you can set the file name and path via the browser.bookmarks.file pref on the about:config page.
    * http://kb.mozillazine.org/browser.bookmarks.file
    The browser.bookmarks.file pref doesn't exist by default and you need to create a new String pref with the name browser.bookmarks.file and set the value to the full path of the backup bookmarks file.
    Note: an HTML backup doesn't preserve tags and annotations, so you lose those if you need to import the HTML backup.
    * http://kb.mozillazine.org/Export_bookmarks

  • Set primary file as not required

    Hi,
    In a check-in form, there are two fields to upload a file:
    Primary file with is mandatory.
    Alternate file with is not mandatory.
    Based on fact that those fields are not listed in the configuration manager metadata list, is it possible to set Primary file field as not required?
    This procedure is necessary because sometimes I have to check in metadata from physical files (document on paper) and later, update the content with the scanned file (digital document).
    Thank you in advance.
    José.
    Edited by: José Márcio T. Jr on 21/03/2013 06:44

    See here: Re: Checking in content without defining a primary/secondary file

  • Search String in PDF file - MAC Apple Script

    I want to write a Script for Searching String in a PDF File.
    I start with Apple Script and the last 2 days i searching to eliminate the error in the Script.
    set Datei to choose file
    tell application "Adobe Acrobat Professional"
    open Datei
    activate
    find text Datei string "01.07.08"
    end tell
    The script will stopped in line from find text.
    The scrippt will be load a PDF file, activate it an i want to search "01.07.08" and marked it.
    Please help me.
    Thanks michael

    Right, I think I've got on to something here:
    1. I must not have been able to search this particular pdf document in the past, despite what I think I remember.
    2. When I select the Yamaha TDM pdf in Finder and show the Inspector window (CMD-opt-I) I see under "More Info" that Security Method is 'Password Encrypted'. In fact, try to select and copy some of the text: you can't. BUT: print the whole file to a new PDF, then save that new pdf file and use it for searching, ... ta-da! it works!
    I was a bit disappointed in ColorSync's inability to open the file and then Save it As... In the Tiger days, I had used this work-around: I took a password encrypted pdf document, opened it in ColorSync utility (in Applications/Utilities) and saved it under a new filename somewhere on the disk, and this process sort of neglected to cloak it up in its password-protection.
    Oh well, I suppose I can use the Print to PDF method which I describe just here to achieve the same goal. Until, that is, the big-wigs in the publishing companies and Apple are alerted to this fact and strip the 'functionality' from the print process.
    Thanks for posting.

  • It should be possible to set default behavior for all file types

    It should be possible to set a default action for all file types. I'm so tired of having to manually sit and say "save this file" because Firefail always defaults to "open with" and has disabled the "Do this automatically for files like this from now on."
    And spare me the zealotry religious excuses for why its the fault of websites and not Firefail
    ''edited to remove swearing''

    I do want users to have full control to be able to set any folder view they want by using Apply to Folders; I just want to set the initial/default view to Detail because that matches what the majority of my users want.
    That is, what registry setting changes when I go to a picture folder, change the view to Detail, and click Apply to Folders? Having done that, I still retain the ability to change it to some other view and apply that to folders. But what registry setting
    represents the change I just made when applying Detail view to all Picture folders.?
    This settings is simple via GUI, but it is related a lot of registry keys, I made a test in my machine, capture the "Apply to Folders" process using Regshot tool (this is a small tool which can compare the regsitry changes after you change some
    settings), and this is the result:
    this is part of the registry changes, a plenty of registry keys and values need to be changed. hard to list them here. if you have interests, I recommend the tool Regshot, it can help you capture the regsitry changes.
    NOTE: Please Note: The third-party product discussed here is manufactured by a company that is
    independent of Microsoft. We make no warranty, implied or otherwise, regarding this product's
    performance or reliability.
    Yolanda Zhu
    TechNet Community Support

  • Is it possible to set an opening date for a password protected file

    Is it possible to set an opening date for a password protected file!
    I want to lock a folder and then have it open on a perticular date not just open with a password so that i am not tempted to open it. Is it possible?

    Yes. Go to the Settings app, and select safari. There will be a section called "Autofill", and you can enable it to save your passwords and auto-fill your personal information taken from the address book. Also, iOS automatically saves all Wi-Fi passwords, so there is no need to save it manually yourself.

  • Max. heap size - possibility to set in jar file ?

    Hi everybody,
    my first question ;-)
    I used java webstart for a while to roll out my software to 2 other colleagues. There was a possibility to set the starting and maximum heap size via the jnlp file. Recently I switched my "deployment process" to a simple jar file. I looked through the jar docs and googled a bit until I found this in the [bug database|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4682105]
    and especially:
    When jar file is read the maximum heap size is already set.
    It is not feasible to introduce this feature.
    So the only way to do this is using a script ?
    Thanks in advance and enjoy your day,
    Michael

    Thanks for your quick and economic response.
    Another way would be to use a tool like Launch4j which builds an exe file. Until now I have not been a friend of exe files for java programs. Since my application is only used in Windows environment I will have to rethink this opinion.

Maybe you are looking for

  • MacBook Pro Running slow, need some tips please.

    Hi all, been a while since I've been in the forums. I have a year and a half old MBP, 2.16ghz w/ 2GB ram. As the months roll by, it seems as if its performance has gone downhill. I think it might be a few factors: 1, about a year ago I ran VMware fus

  • How do I remove my AddressBook folder from dropbox on my old imac and transfer it to my new imac with lion so I can use iCloud?

    How do I remove my Address Book folder from dropbox on my old Imac and move it to my new mac so I can use icloud

  • Planning Task List Due Date

    Dear All, When we create planning task list we can aslo assign due date for each task with in task list. This due date has three components 1. Date 2. Time 3. Alert However time is denoted in EDT (Estern Daylight Time). As we are implementing the pro

  • Illegal Access Error : using Custom Tags

    Ive a very simple custom tag that try to print curent date on webpage but when I try to run it gives me following error java.lang.IllegalAccessError: try to access class com.sun.xml.tree.ParentNode from class org.apache.jasper.compiler.TagLibraryInfo

  • Trouble with OS X 10.3 apps?

    Hello. I have an iBook G4 running 10.3. I am having trouble with the applications that are part of the OS X system. I first noticed this with iPhoto because I use it a lot. When I click the icon the program launches but will not start (proper term?)