Professional Web Applications Themes

Finder macros in OSX - Mac Applications & Software

On Sat, 12 Jul 2003 14:26:04 +1000, heron stone wrote (in message <heronstone-9F4049.21260411072003news-central.giganews.com>): > I want to automate a simple finder procedure that I do several times > almost every day and a friend tells me that Apple Script won't do it. > > Here's what I want to do... > > in the finder > > select several files in a folder Presumably you want the user to do this before running the script [IMNSHO a script should _never_ change the Finder selection, unless that is part of the main function of the script - e.g. 'reveal this item ...

  1. #1

    Default Re: Finder macros in OSX

    On Sat, 12 Jul 2003 14:26:04 +1000, heron stone wrote
    (in message
    <heronstone-9F4049.21260411072003news-central.giganews.com>):
    > I want to automate a simple finder procedure that I do several times
    > almost every day and a friend tells me that Apple Script won't do it.
    >
    > Here's what I want to do...
    >
    > in the finder
    >
    > select several files in a folder
    Presumably you want the user to do this before running the script
    [IMNSHO a script should _never_ change the Finder selection, unless
    that is part of the main function of the script - e.g. 'reveal this
    item to the user']

    If not then you could put a 'choose files' dialog in the script
    below...
    > Get Info
    You only need to do this if you want to see what's there. The
    script doesn't need to. [Applescript isn't a 'macro' language, UI
    manipulation should be seen as an 'approach of last resort']

    > expand Names & Extension panel
    >
    > check the Hide extension box
    >
    > close the Get Info window
    Same as above comment.
    > This seems like such a simple thing but I've been unable to get
    > Apple Script to do it.
    >
    > How can I do this?
    set theItems to {}
    tell application "Finder"
    set theItems to selection
    repeat with i in theItems
    set extension hidden of i to true
    end repeat
    end tell

    You might want to tell the finder to 'update' the enclosing folder
    after the repeat loop finishes.
    > Do I need a 3rd-party app?
    No.

    Have Fun
    Martin

    Martin Crisp Guest

  2. #2

    Default Re: Finder macros in OSX

    In article
    <heronstone-9F4049.21260411072003news-central.giganews.com>, heron
    stone <heronstoneattbi.com> wrote:
    > I want to automate a simple finder procedure that I do several times
    > almost every day and a friend tells me that Apple Script won't do it.
    >
    > Here's what I want to do...
    >
    > in the finder
    >
    > select several files in a folder
    >
    > Get Info
    >
    > expand Names & Extension panel
    >
    > check the Hide extension box
    >
    > close the Get Info window
    >
    > This seems like such a simple thing but I've been unable to get
    > Apple Script to do it.
    >
    > How can I do this?
    > Do I need a 3rd-party app?
    Files have a property called "extension hidden" that can be set to true
    or false. Driving the interface is the long and hard (and, in an
    application as scriptable as the Finder, basically wrong) way to do it.

    Assuming you want your script to operate on the current selection, you
    could just write something like this:

    tell application "Finder"
    set s to the selection
    repeat with i in s
    set i's extension hidden to true
    end repeat
    end tell

    --
    Jerry Kindall, Seattle, WA <http://www.jerrykindall.com/>

    When replying by e-mail, use plain text ONLY to make sure I read it.
    Due to spam and viruses, I filter all mail with HTML or attachments.
    Jerry Kindall Guest

  3. #3

    Default Re: Finder macros in OSX

    Two very helpful replies... thanks

    The problem is that I don't know what to do with the script
    that i created with script editor.

    There must be a better way of running it than opening it in
    the editor and selecting RUN.

    Is there a way to activate it from a contextual menu.

    I've seen that some apps have a SCRIPT menu item, but i don't
    see that in the finder.

    What's the easiest way to invoke the new script

    thanks

    heron

    --
    Nature, heron stone
    to be commanded, [email]heronstoneattbi.com[/email]
    must be obeyed. [url]http://home.attbi.com/~heronstone/[/url]

    heron stone Guest

  4. #4

    Default Re: Finder macros in OSX

    In article
    <heronstone-5CE692.22195712072003news-central.giganews.com>, heron
    stone <heronstoneattbi.com> wrote:
    > Two very helpful replies... thanks
    >
    > The problem is that I don't know what to do with the script
    > that i created with script editor.
    >
    > There must be a better way of running it than opening it in
    > the editor and selecting RUN.
    >
    > Is there a way to activate it from a contextual menu.
    >
    > I've seen that some apps have a SCRIPT menu item, but i don't
    > see that in the finder.
    >
    > What's the easiest way to invoke the new script
    Add a script menu to your menu bar.

    /Applications/AppleScript/Script Menu.menu

    Read more about it here: [url]http://www.apple.com/applescript/script_menu/[/url]

    --
    Jerry Kindall, Seattle, WA <http://www.jerrykindall.com/>

    When replying by e-mail, use plain text ONLY to make sure I read it.
    Due to spam and viruses, I filter all mail with HTML or attachments.
    Jerry Kindall Guest

  5. #5

    Default Re: Finder macros in OSX

    > > What's the easiest way to invoke the new script
    >
    > Add a script menu to your menu bar.
    >
    > /Applications/AppleScript/Script Menu.menu
    >
    > Read more about it here: [url]http://www.apple.com/applescript/script_menu/[/url]


    that is soooo cool

    thank you

    heron

    --
    Nature, heron stone
    to be commanded, [email]heronstoneattbi.com[/email]
    must be obeyed. [url]http://home.attbi.com/~heronstone/[/url]

    heron stone Guest

  6. #6

    Default Re: Finder macros in OSX

    Hey Jerry and Martin, thanks you for helping me with Apple Script.

    You guys were so nice that i figured that i'd prevail upoon you
    again to go a little further into this.

    Hiding the extension is only the last of several parts of this
    procedure and it became clear to me after seeing the script you
    guys provided that the whole process lends itself to automation.

    So maybe one of you would be kind enough to show me a script that
    would do the whole thing.

    Here's what i have been doing...

    I'm moving WAV files off my handheld onto my Mac and archiving them.
    All the files from a day are trasnsferred into a folder labelled with
    today's date (in lunar calendar format).

    They are named in the handheld thusly... 030715000.WAV, 001.WAV,
    002.WAV, etc. (year, month, day and 3-digit index)
    So i drag these files into a folder named 218.17 (corresponding to
    030715)

    I use A Better Finder Rename to create a numbered list of 3 digits.
    eg. 001.WAV, 002.WAV, etc.
    Then i again use ABFR to add the date to the beginning resulting in
    files named 218.17.001.WAV, 218.17.002.WAV, etc.

    Finally, i hide the extension.

    The main points:
    1. rename files as 3-digit numbered list
    2. add the name of the folder in which they reside (plus a period)
    to the beginning of every file resulting in 218.17.001.WAV
    3. hide extension (which you have already kindly provided)

    And finally, can you direct me to learning resources for Apple Script?
    Are there tutorials available, urls, etc.?

    Any help will be much appreciated.

    thanks

    heron

    --
    Nature, heron stone
    to be commanded, [email]heronstoneattbi.com[/email]
    must be obeyed. [url]http://home.attbi.com/~heronstone/[/url]

    heron stone Guest

Similar Threads

  1. Macros in Illustrator?
    By Melanie_Comentino@adobeforums.com in forum Adobe Illustrator Windows
    Replies: 1
    Last Post: July 2nd, 02:55 PM
  2. macros
    By T. Onoma in forum Ruby
    Replies: 12
    Last Post: November 19th, 07:28 AM
  3. macros in Photoshop?
    By James G Porter in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 1
    Last Post: August 27th, 11:23 PM
  4. [PHP-DEV] userland macros
    By Cristiano Duarte in forum PHP Development
    Replies: 0
    Last Post: August 18th, 06:57 PM
  5. macros in perl
    By marc0 in forum PERL Miscellaneous
    Replies: 17
    Last Post: July 18th, 09:26 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139