Skip to content

Instantly share code, notes, and snippets.

@logic2design
Created January 25, 2020 08:00
Show Gist options
  • Save logic2design/1dae1ec2c770303bc55b162afdf6dd23 to your computer and use it in GitHub Desktop.
Save logic2design/1dae1ec2c770303bc55b162afdf6dd23 to your computer and use it in GitHub Desktop.
tell application "Finder" to set shortName to name of (theFile as alias)
set theDialogText to "What is the Project name? - " & shortName
set theButtonIfPressedTheRuleWillContinue to "Next"
set theButtonIfPressedRuleAborts to "Skip"
set theDialogTitle to "Rename Folder"
tell application "System Events"
activate
set theResult to (display dialog theDialogText with title theDialogTitle default answer "" buttons {theButtonIfPressedTheRuleWillContinue, theButtonIfPressedRuleAborts} default button 1 giving up after 60)
end tell
if (button returned of theResult) is theButtonIfPressedTheRuleWillContinue then
set theText to text returned of theResult
return {hazelExportTokens:{Projectname:theText}}
end if
return {hazelExportTokens:{Projectname:""}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment