• 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
Re: name of script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: name of script


  • Subject: Re: name of script
  • From: Kai Edwards <email@hidden>
  • Date: Tue, 26 Mar 2002 23:51:40 +0000

on Tue, 26 Mar 2002 09:16:31 -0500, Michael Malchiodi
<email@hidden> wrote:

> Hi, I am new to applescript and have a question regarding. I need to parse
> the name of the currently running applescript application. I need to
> perform this call on a compiled script saved as a classic application and
> on a compiled script saved as a macos x application. Example my
> application is named getmacaddress-mm649.bin I need to parse out the mm649
> and capture it inside the script via a variable.

Try this, Michael:

-----------------------------------
set myVariable to parse(path to me)
-- do something with myVariable

on parse(myPath)
set tid to text item delimiters
set text item delimiters to ":"
set txt to (myPath as string)'s last text item
set text item delimiters to "-"
set txt to txt's last text item
set text item delimiters to "."
set txt to txt's first text item
set text item delimiters to tid
txt
end parse
-----------------------------------

(To work properly, the script must first be saved as an application.)

HTH

Kai

--

**********************************
Kai Edwards Creative Resources
1 Compton Avenue Brighton UK
Telephone +44 (0)1273 326810
**********************************
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Where is application
  • Next by Date: re: Decomposing a B&W bitmap graphic (or ideally, a font bitmap)
  • Previous by thread: name of script
  • Next by thread: Quark PPD Options
  • Index(es):
    • Date
    • Thread