How do I use AppleScript to Change the Creation Date to the Current Date?

I sorted my downloads folder by creation date and found that the items were sorted seemingly randomly. On closer inspection, I saw that the creation dates were not the same as the dates that I downloaded the items, so I figures that Snow Leopard was using the date given to it by the server.
In order to get the items sorted by download date, I figured I'd use Hazel, but it doesn't have a “change creation date” item. It does, however, have an “run AppleScript” item.
So my question is this: how do I use AppleScript to change the creation date of an item to the current date?

TC (Techno Cat) wrote:
Okay, I tried changing the creation date with SetFile, but it kept giving me an error:
What am I doing wrong?
Looks like the date and time was not quoted
Try this Applescript. It will change the creation date of every file in the Downloads folder to the current date and time:
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
font-weight: normal;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px;
color: #000000;
background-color: #E6E6EE;
overflow: auto;"
title="this text can be pasted into the AppleScript Editor">
set current_date_and_time to do shell script "date \"+%m/%d/%Y %H:%M\""
tell application "Finder"
set filelist to every file of the alias (the path to downloads folder as text)
repeat with currentFile in filelist
do shell script "/usr/bin/SetFile -d " & quoted form of current_date_and_time & space & quoted form of POSIX path of (currentFile as string)
end repeat
end tell</pre>

Similar Messages

  • How can i use dsadm to change the ldap port?

    I have a ldap with port 1389,I changed it to 389,now I can not start it because it is a non root user.
    Now I want to change the port back to 1389,but I can not use dsconf because the server is not running.
    How can i do now? How can i use dsadm to change the port?
    Thank u very much.

    My apologies, I didn't mean to be rude/impolite.
    I just wanted to emphasize that in a situation where a Directory Server doesn't even start, you cannot interact with the live server to configure the new port (either talking LDAP or otherwise). All you can do in that case won't be related with the LDAP (that's just the name of the protocol): either assigning network privileges to the user, or changing the Directory Server configuration file.
    The other thing I'd like to outline (and this could take a separate thread ;-) ), is that semantically, I'd prefer talking of a Directory Server instead of an LDAP Server because the former is 'something' providing Directory Services, whereas the latter is just the name of the protocol we use to interact with the server; but this is just my personal opinion, you don't have to agree with me.
    that's all folks!
    marco

  • How could I using synth to change the titledborder?

    I want to change the font and border image of titledborder, how could I do?

    http://java.sun.com/docs/books/tutorial/uiswing/components/border.html

  • Applescript to get the current insertion point of the cursor

    How do I use Applescript to get the current insertion point of the cursor in a Apple pages.app document?

    Oops, missed that one - you are correct, the line should be:
    <pre title="this text can be pasted into the Script Editor" style="font-family: Monaco, 'Courier New', Courier, monospace; font-size: 10px; padding: 5px; width: 720px; color: #000000; background-color: #E0E0E0; overflow: auto">set {TheStart, TheEnd} to character range of the selection</pre>
    I have a wrapper script that I use to insert stuff from my handler/code library into a Script Editor document, and was adapting snippets from that for my examples - I guess that one got away.
    As for the dictionary, some applications just have poorly written or outdated documentation. Some of the items have multiple entries (eg, there may be a selection object for the application and also for the document), and some inherit properties from other items. Some are used as nouns, others as verbs (or both). Sometimes it is easier to visualize the item by keeping track of it's reference - the 'some property of document 1 of the current application' thing. You can use the Script Editor's Event Log to see the results of various properties and commands - for example, the above script will result in the following entry (your numbers will vary depending on the selected text):
    <pre title="this text can be pasted into the Script Editor" style="font-family: Monaco, 'Courier New', Courier, monospace; font-size: 10px; padding: 5px; width: 720px; color: #000000; background-color: #E0E0E0; overflow: auto">tell current application
    get character range of selection
    {50, 50}
    end tell
    </pre>
    You can also use the 'log' statement (eg, 'log MyVariable') to add your own entries into the log instead of using dialog boxes.

  • How can i use my account without the billing info, as i do not have a credit card. and my shipping and billing info is under US. i'm in singapore. how do i change this?

    how can i use my account without the billing info, as i do not have a credit card. and my shipping and billing info is under US. i'm in singapore. how do i change this?

    If you are just visiting Singapore, then leave the account as it is. If you have moved there, then view your account using the iTunes app on a Mac or PC and change the country/region to your current location and address. If you do not have a bank card, you can fund your account using iTunes gift cards if available in Singapore.

  • How can you turn off the braille setting on an iPhone 4s, once on it won't let you slide the phone into use mode to change the settings or do anything?

    How can you turn off the braille setting on an iPhone 4s, once on it won't let you slide the phone into use mode to change the settings or do anything?

    An alternate method is Accessibility Settings when connected to iTunes. You should be able to turn it off there. I would also check out some of the answers listed to the right of this post and see if they can help.

  • How can I use Applescript to copy a file's icon to the clipboard?

    Hello,
    How can I use Applescript to copy a file's icon to the clipboard?
    Thanks.
    Lennox

    there is no way to do that that I know of. but you can extract an icon of a file to another file using command line tool [osxutils|http://sourceforge.net/projects/osxutils]. you can then call the relevant command from apple script using "do shell script".

  • How can I use AppleScript Studio to display an image

    How can I use AppleScript Studio to display an image in a dialog?

    Add an image well to your window in Interface Builder.
    You can also add an image file to the Resources group of your Xcode project and then set the image to be displayed inside the image well directly in Interface Builder. No AppleScript code is needed if the image is contained within your app bundle and can be set ahead of time like this.
    If the image is contained in your app's bundle but you need to set or change the image at run time then you can use a line of AppleScript to load it into the image well using just it's filename:
    set image of image view "yourImageView" of window "yourWindow" to load image "YourImageFile.jpg"
    If you need to load an image from an arbitrary location outside your app's bundle then use a path to the image file...
    set image of image view "yourImageView" of window "yourWindow" to load image "/path/to/YourImageFile.jpg"
    Steve

  • How do I stop GoLive from changing the location of my CSScriptLib.js file?

    How do I stop GoLive from changing the location of my CSScriptLib.js file?
    I am making rollovers and want my CSScriptLib.js to be in the same folder as my HTML files.
    Every time I edit the rollovers GoLIve recreates the path of the CSScriptLib.js to file:///Users/xxx/Library/Preferences/Adobe/GoLive/Settings8/JScripts/GlobalScripts/CSScr iptLib.js so it won't work when uploaded. I always need to edit my HTML before uploading. All I want it to say is src="CSScriptLib.js" as the default.

    The site file is a database that keeps track of all your assets (and much more), including the scriptLib file. As soon as the page is saved (when you use the site file and it's open) the link will be change to the correct path that will work on the server.
    If you're not using the site file you might as well use a text editor, since most of GL functionality is gone.

  • How can i use my tv as the 2nd monitor

    hi, how can i use my tv as the 2nd monitor, for example pull a video from desktop to tv for windows7, the computer is hp omni 120 all in one. because i have a cable for it that connects to the tv but i dont know how to connect the pc to the tv. i tried to go on the 'change screen resolutions' but that didnt help. thanks

    Hi,
    Here is it specs:
       http://h10025.www1.hp.com/ewfrf/wc/document?cc=us&lc=en&dlc=en&docname=c03343048#N1221
    You can only see:
    Front:
    1 - Screen area
    2 - Microphone array
    3 - Webcam camera
    4 - Stand
    5 - Speakers
    Back:
    1 - Optical disk drive (actually right)
    2 - Stand
    3 - Kensington lock slot
    4 - Power button
    5 - Memory card reader and other I/O on left side
    6 - Motherboard back I/Os (specific I/Os are model dependent)
    7 - Activity indicator
    8 - Power connector
    9 - LAN (ethernet)
    10 - Four USB 2.0 ports
    11- Audio port (actually left side)
    Left:
    1 - Hard drive activity indicator
    2 - Memory card reader activity indicator
    3 - Memory card reader
    4 - Two USB 2.0 ports
    5 - Microphone jack
    6 - Audio port
    Right:
    1 - Optical disc drive
    The only hope is "6 - Motherboard back I/Os (specific I/Os are model dependent)" area:
    Please check area 6 above. As mentioned in my previous reply: Most likely your machine has no video out port.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • How do I find and/or change the pre-set voltage selection switch in an HP TouchSmart IQ500 series

    how do I find and/or change the pre-set voltage selection switch in an HP TouchSmart IQ500 series (specifically an IQ524)
    This question was solved.
    View Solution.

    Doesn't it use an external AC Adapter? If so, all you should need to use in another country is an adpater plug to match the wall socket.
    ... an HP employee expressing his own opinion.
    Please post rather than send me a Message. It's good for the community and I might not be able to get back quickly. - Thank you.

  • Using javascript to change the "Overall Result" cell in WAD

    Hi experts,
    I am trying to use javascript to change the text of the "Overall Result" cell in my web template using BI 7.0. I am not familiar with javascript, but I this is what I have done so far.
    I dragged the web item "Script" into my web template and I inserted the following code:
    function change_overall_result_to_average() {
    var cell = document.getElementsByTagName("TD");
    var cellText;
    for (i = 0; i < cell.length; i++)
          cellText = cell<i>.innerText;
               if (cellText == "Overall Result")
                     cell<i>.innerText = "Average";               
    In the XHTML view I am using added the onload function to start the javascript every time the web template is loaded. The code works fine when the web template is first loaded and the cell text is changed to "Average". However, if I navigate in my web template, the javascript function is not triggered, and the cell is therefore changed back to "Overall Result". For example, this happens when I pick another selection from one of my dropdown boxes, such as changing the selection from year 2008 to year 2007.
    I don't really know how to solve this problem in an easy way, and the current solution is not good enough. I hope one of you guys can suggest an easy way of fixing this:-)
    Best Regards,
    Morten

    Woodstock apparently renders some Javascript/DOM with some homegrown widget framework which on its turn renders the HTML DOM tree instead of plain vanilla HTML. Correct me if I'm wrong, to confirm this, just view the generated HTML source of the page.
    After some Googling I found out that you need getProps() and setProps() to get and set element attributes respectively.
    [http://google.com/search?q=webuijsf+domnode+site:sun.com].
    If you stucks with this, I recommend you to post this question at a forum or mailinglist devoted to Woodstock, e.g at their own homepage at dev.java.net or the Netbeans forum at nabble.com. You're here at a Sun JSF forum, not at a Woodstock forum.

  • How can we restricted not to change the bach no in GR

    Hi All,
    When we do MIGO with ref to P.O or With ref to Out bound delivery , how can we restricted not to  change the bach no.
    Please guide me.
    Thanks and Regards
    Chandru

    Hi Chandrashekar,
    I am assuming that, you dont want batch to be changed duirng GR for a PO, but you can choose from existing batches in the system.
    in SPRO->logistic General->batch management->Creation of New batches->Define Batch creation for goods movement.
    Here you can control the way the batches can be popolated. Varous option are available which can be used too.
    Please make detail process validation defore usign this option.
    Please reward if useful.
    thx,
    MJ

  • How to reverse from quality and change the vendor account.

    I had made GR, but posted wrong entries, instead of doing one vendor account & i had made in other vendors account, this lot is passed by quality also that means it UD is also done.
    how to reverse from quality and change the vendor account.
    Thanks and Regards

    hi Raj,
    Reversing Stock Postings Locate the document in its SAP Library structure
       1. Choose Logistics ® Materials Management ® Inventory Management ® Goods Movement ® Goods receipt ® For purchase order ® PO number known.
    The initial screen for creating a goods receipt for a purchase order appears.
       2. In the field for the movement type, enter
       3. 102 (goods receipt for a purchase order into warehouse - reversal). In the field for the purchase order, enter the purchase order number for the original goods receipt.
    Note
    You can copy the purchase order number from the inspection lot.
       4. Choose Enter to display the selection screen for the purchase order items.
       5. Select the purchase order item for which you want to create the goods receipt and set the Stock type indicator to the stock to which the goods were originally posted with the usage decision (for example, F for unrestricted-use stock or S for blocked stock).
       6. Save the goods receipt and exit the Materials Management component.
       7. Choose Logistics ® Quality management ® Quality inspection ® Inspection lot ® Usage decision ® Change with history.
    The initial screen for changing a usage decision appears.
       8. Enter the number of the inspection lot for which you previously made the usage decision and choose Usage decision (UD).
       9. To cancel the inspection lot, choose Usage decision ® Functions ® Cancel lot in the usage decision screen.

  • Urgent:How to modify a script without changing the print programme

    Hi all,
    Can any body pls tell me <b>How to modify a script without changing the print programme</b>
    Give m esome real time examples.
    Good points willbe rewarded
    Thanks

    Hi
    You can write a external Subroutine to fetch the extra data into the script program
    see the following sample code
    How to call a subroutine form SAPscripts
    The Form :
    /:PERFORM CDE_CENT IN PROGRAM ZKRPMM_PERFORM_Z1MEDRUCK
    /:USING &EKKO-EBELN&
    /:CHANGING &CDECENT&
    /:ENDPERFORM
    The report :
    REPORT zkrpmm_perform_z1medruck .
    DATA : BEGIN OF it_input_table OCCURS 10.
    INCLUDE STRUCTURE itcsy.
    DATA : END OF it_input_table.
    déclaration de la table output_table contenant les
    variables exportées
    DATA : BEGIN OF it_output_table OCCURS 0.
    INCLUDE STRUCTURE itcsy.
    DATA : END OF it_output_table.
    DATA : w_ebeln LIKE ekko-ebeln,
    w_vbeln LIKE vbak-vbeln,
    w_zcdffa LIKE vbak-zcdffa.
    FORM CDE_CENT
    FORM cde_cent TABLES input output.
    it_input_table[] = input[].
    it_output_table[] = output[].
    READ TABLE it_input_table INDEX 1.
    MOVE it_input_table-value TO w_ebeln.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = w_ebeln
    IMPORTING
    output = w_ebeln.
    SELECT SINGLE zcdffa FROM ekko
    INTO w_zcdffa
    WHERE ebeln = w_ebeln.
    it_output_table-name = 'CDECENT'.
    MOVE w_zcdffa TO it_output_table-value.
    MODIFY it_output_table INDEX 1.
    output[] = it_output_table[].
    ENDFORM.
    COPING SCRIPT
    There are some Standard Sap Scripts in SAP. We cant directly execute them in scripts we have to use some T-codes and by giving some input to the required fields we can see the output printform.
    I will show one example. There are some Standard Sap Scripts such as MEDRUCK which is a standard Sap Script for Purchase Order and RVINVOICE01 for billing and so on...
    To see oupt of MEDRUCK go to T-code ME9F give purchase order number and execute select one number and click on dislplay messages button on application tool bar you can find the print form of MEDRUCK.
    You cannot change the Standard Sap Scripts but you can use Standard Sap Scripts and Copy them to userdefined Script and can make changes to them and replace standard Sap Script with usedefind script.
    Ex: Go to SE71,
    on menu bar u find Utilities->copy from Client. click on it u ll find new screen showing
    Form name:
    Source Clinet:
    Target Form:
    give Form name as usedefined form name EX: ZFORM1
    Source client as 000 and
    Target form as MEDRUCK.
    execute.
    Now, the standard from MEDRUCK is copyied to your form ZFORM1.
    NOW, go to SE71 and give form name as ZFORM1 and do some changes to the form such as adding logo any thing. save and Activate.
    Now, you have done changes to the Form ZFORM1 and u have to replace your form with standard SAP Script.
    Go to NACE Transaction.
    on Applications select EF for purchase order and click Output types button on application tool bar.
    now select NEU as output types dobule click on Processing Routines.
    now click on Change option on application tool bar and on right side u find MEDRUCK in form place replace MEDRUCK with ZFORM1 and SAVE.
    go back twice and now go to T-code ME9F give the purchase order number and execute and select one option and click on display messges button .
    you will find the changes that you have done in ZFORM1. so we cant chage the standard Sap Scripts by copying the Standard Sap Scripts we can chage and replace with our forms
    Refer
    https://forums.sdn.sap.com/click.jspa?searchID=4089895&messageID=3239299
    Regards
    Message was edited by:
            Kiran Sure(skk)

Maybe you are looking for

  • Open VI reference, problem on RT target

    I'm having problems opening references to VI's on my RT target (cRIO 9074 with NI-RIO 3.1.0, VI server enabled). I'm using Labview 8.6.1 What I'm doing is opening the reference using an absolute path ("c:\ni-rt\temp\test12.vi") to the VI I want to ru

  • The server farm account should not be used for other services

    I have created a new SharePoint Foundation 2013 Farm. I only used the Farm Configuration Wizard to create the Search Service Application, all other aspects of the Farm was created using PowerShell. The SharePoint Health Analyzer is reporting the foll

  • Not able to use a function inside a sql in a form, Why ??

    Here SERIAL_NUM is a function, this sql work fine in TOAD and SQLPLUS but inside the form iam getting error saying "function serial_num cannot be used in a sql" Why is it like that ?? Is there anyother way to execute this sql ? cursor c1 is SELECT ms

  • Error when emailing XML document

    Hi there I am trying to email an XML document to an external vendor by using the CL_DOCUMENT_BCS class.  The email is sent successfully and I receive it in the relevant mailbox.  To make it an XML document, I move 'XML' to the I_TYPE parameter of the

  • Reg function module POSTING_INTERFACE_CLEARING

    Dear experts, I have a requirement in tcode FB05(Posting with clearing: Initial screen).  In that i need to select the radio button 'Transfer Posting with Clearing'.  I dont know exactly what happens here. I have to use function module POSTING_INTERF