• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
basic scripting with Excel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

basic scripting with Excel


  • Subject: basic scripting with Excel
  • From: "Mike Eddington" <email@hidden>
  • Date: Tue, 3 Apr 2007 12:46:15 -0400
  • Thread-topic: basic scripting with Excel

I'm trying to create a script that will open a .txt in Excel to perform some functions. The issue I have is simply opening the files which will be of various names. I'm very new to Applescript (i.e. clueless), but I had used the following to open files/folders of variable names with another software in the past, but its not working with Excel.

 

 display dialog "Drag files or folders to be processed here"

 

on open these_items

   

    repeat with i from 1 to the count of these_items

        set this_item to (item i of these_items)

        set the item_info to info for this_item

        if folder of the item_info is true then

            process_folder(this_item)

        else if (alias of the item_info is false) then

            my process_item(this_item)

        end if

    end repeat

end open

 

 

on process_folder(this_folder)

    set these_items to list folder this_folder without invisibles

    repeat with i from 1 to the count of these_items

        set this_item to alias ((this_folder as text) & (item i of

these_items))

        set the item_info to info for this_item

        if folder of the item_info is true then

            process_folder(this_item)

        else if (alias of the item_info is false) then

            my process_item(this_item)

        end if

    end repeat

end process_folder

 

on process_item(this_item)

   

    tell application "Microsoft Excel"

        Activate

        Open item this_item

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Re: Odd AS user account problem...
  • Next by Date: Re: EPS to WMF or other vector file format for MS WORD
  • Previous by thread: Re: Puzzling display dialog
  • Next by thread: RE: basic scripting with Excel
  • Index(es):
    • Date
    • Thread