Re: can this be simplified?
Re: can this be simplified?
- Subject: Re: can this be simplified?
- From: Vincent <email@hidden>
- Date: Tue, 3 Aug 2010 19:36:31 +0400
Can you please document the lines?How come the script below also replace "(" and ")"
Idea here is to have users copy the subject line of a new job received by mail and click on the button script.
im not an expert using applescript and took me quite some time to get up to this. Simpler, but it doesn't work exactly the same way your first script did. But if it works for you, you can lose a couple lines...
set JobBagName to (the clipboard as text) set AppleScript's text item delimiters to {"_"} set JobBagName to "" & words of JobBagName as text set JobBagFinalName to text returned of (display dialog "Name of New Job Bag - Nouveau Dossier" default answer JobBagName buttons {"OK", "Cancel"} default button 1) 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
Here's another version that may be simpler for your users:
set JobBagName to (the clipboard as text) set AppleScript's text item delimiters to {"_"} set JobBagName to "" & words of JobBagName as text set newJobBag to (choose file name with prompt "Select Folder for Job Folder Creation - Destination du Nouveau Dossier" default name JobBagName) as text set AppleScript's text item delimiters to {":"} set JobBagFinalName to the last text item of newJobBag set destination to ((text items 1 thru -2 of newJobBag) as text as alias) 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