Loading ...
Sorry, an error occurred while loading the content.

Re: A classic Finder scripting question

Expand Messages
  • John Rethorst
    ... This works fine OMM with OS 10.4.3: set folder1 to (path to desktop as string) & folder 1 set folder2 to (path to desktop as string) & folder 2 tell
    Message 1 of 4 , Dec 5, 2005
    • 0 Attachment
      --- In wordperfectmac@yahoogroups.com, John Kaufmann <kaufmann@n...> wrote:
      >
      > This *should* a simple question - how to delete, or move to another
      > location, all files or items in a specified a folder - yet the answer
      > eludes me. For example, I thought it should be possible to say:
      >
      > set tempfolder to "HD:F3"
      > tell application "Finder"
      > move every item of folder ("HD:F1:F2") to folder tempfolder
      > end tell
      >
      > But nothing happened.

      This works fine OMM with OS 10.4.3:

      set folder1 to (path to desktop as string) & "folder 1"
      set folder2 to (path to desktop as string) & "folder 2"
      tell application "Finder" to move every item of folder folder1 to folder folder2

      I think this syntax did not change from Classic to X.

      >[It's enough to
      >make a body wish BATch or Rexx or some other less "friendly"
      >scripting language were available under MacOS.]

      Or at least a better editor. Try the free "Smile" at:

      http://www.tucows.com/preview/207118

      I found the interface daunting at first, but it's very capable.

      John R.
    • John Kaufmann
      ... Hmm... a good test, in that it quickly exposes a difference between OS 8.6, with AS 1.3.7 (where it works) and OS 7.6.1, with AS 1.1 (where it does not
      Message 2 of 4 , Dec 5, 2005
      • 0 Attachment
        At 051205 23:06 +0000, John Rethorst wrote:

        >This works fine OMM with OS 10.4.3:
        >
        >set folder1 to (path to desktop as string) & "folder 1"
        >set folder2 to (path to desktop as string) & "folder 2"
        >tell application "Finder" to move every item of folder folder1 to
        >folder folder2

        Hmm... a good test, in that it quickly exposes a difference between

        OS 8.6, with AS 1.3.7 (where it works)
        and
        OS 7.6.1, with AS 1.1 (where it does not work)

        (Both use AppleScriptLib 1.2.2.) Unfortunately, both are target
        environments for this script, and it was while I was trying to fix a
        problem in a classroom running 7.6.1 that I ran into the problem
        which prompted this thread. Also unfortunately, 7.6.1 will not run
        AppleScript 1.3.7, so I may be stuck on this problem.

        >>[It's enough to make a body wish BATch or Rexx or some other less "friendly"
        >>scripting language were available under MacOS.]
        >
        >Or at least a better editor. Try the free "Smile" at:
        >
        >http://www.tucows.com/preview/207118
        >
        >I found the interface daunting at first, but it's very capable.

        It does look interesting in OS 8.6, but I found that I can't run it
        in the other environment 7.6.1, where I'm having trouble to trace
        (and work around) the problem that began this thread. Again, I may
        be stuck. But I want to thank you for - once again - a quick and
        informative reply.
        --
        John K
      • John Rethorst
        ... OS 7.6.1 uses the Finder Scripting Extension. Is it present on your machine and active via Extensions Manager? If so, it may be corrupted; try a new copy
        Message 3 of 4 , Dec 6, 2005
        • 0 Attachment
          --- In wordperfectmac@yahoogroups.com, John Kaufmann <kaufmann@n...> wrote:

          > Hmm... a good test, in that it quickly exposes a difference between
          > OS 8.6, with AS 1.3.7 (where it works) and
          > OS 7.6.1, with AS 1.1 (where it does not work)
          >
          > (Both use AppleScriptLib 1.2.2.)

          OS 7.6.1 uses the Finder Scripting Extension. Is it present on your
          machine and active via Extensions Manager? If so, it may be corrupted;
          try a new copy from Apple. I just ran this script on a 7.6.1 machine,
          running it from Script Editor and as an applet; worked fine.
        Your message has been successfully submitted and would be delivered to recipients shortly.