• 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: can this be simplified?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: can this be simplified?


  • Subject: Re: can this be simplified?
  • From: Vincent <email@hidden>
  • Date: Tue, 3 Aug 2010 07:31:00 +0400

yep simpler

but i dont understand the issue @ :
set AppleScript's text item delimiters to {"___"}
set new to text items of newName
in my original script, why doesnt it replace the 3 _ _ _ in the above pass?

On 02 Aug 2010, at 22:31, Stockly, Ed wrote:

Maybe a bit simpler:

set
newName to (the clipboard as text)
set
AppleScript's text item delimiters to {" ", ".", ":", ";", "-", ","}
set
newName to text items of newName
set AppleScript's text item delimiters to "_"
set
newName to newName as text
repeat
   set AppleScript's text item delimiters to "__"
    
set
newName to text items of newName
   if the (count of newName) is 1 then exit repeat
   set
AppleScript's text item delimiters to "_"
    
set
newName to newName as text
end repeat
set
newName to newName as text
set userChoice to display dialog "Name of New Job Bag - Nouveau Dossier" default answer newName buttons {"OK", "Cancel"} default button 1
set
JobBagFinalName to text returned of userChoice
set destination to choose folder with prompt "Select Folder for Job Folder Creation - Destination du Nouveau Dossier"
tell
application "Finder"
    
set
TheNewJobBag to make new folder with properties {name:JobBagFinalName} at destination
   make folder with properties {name:"SourcesClient_" & JobBagFinalName} at TheNewJobBag
   open TheNewJobBag
end tell



 _______________________________________________
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

  • Follow-Ups:
    • Re: can this be simplified?
      • From: "email@hidden" <email@hidden>
References: 
 >Re: can this be simplified? (From: "Stockly, Ed" <email@hidden>)

  • Prev by Date: Re: List oddity
  • Next by Date: Re: List oddity
  • Previous by thread: Re: can this be simplified?
  • Next by thread: Re: can this be simplified?
  • Index(es):
    • Date
    • Thread