AppleScript: Spaces in Project Names

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

AppleScript: Spaces in Project Names Fri Jun 21, 2019 2:33 pm • by gedeyenite
Greetings all-

I recently cobbled together a Hazel rule with embedded AppleScript that creates new TODO items in an existing PROJECT in THINGS. However, I had to add underscores instead of spaces in the name of the PROJECT both in THINGS and in the [i]AppleScript. Arew the underscores required, or am I missing something?

Original PROJECT name was "MOVIES for MIDS" and it now reads "MOVIES_for_MIDS"

Here is my code:
Code: Select all
--code source: https://www.noodlesoft.com/forums/viewtopic.php?f=2&t=1845

set filepath to theFile as string

tell application "Finder" to set {dispName, nameExt, isHidden} to {displayed name, name extension, extension hidden} of alias filepath
if isHidden or nameExt is equal to "" then
   dispName
else
   (characters 1 through (-2 - (count of nameExt)) of dispName) as text
end if
set baseName to result

--code source:

tell application "Things3"
   make new to do with properties {name:baseName, due date:current date} at beginning of project "MOVIES_for_MIDS"
end tell
gedeyenite
 
Posts: 4
Joined: Fri Jun 21, 2019 2:23 pm

Re: AppleScript: Spaces in Project Names Mon Jun 24, 2019 10:42 am • by Mr_Noodle
Seems like this is more of an issue with Things. Have you tried contacting them about this?
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support