AppleScript creating new folder name and display differ

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

Moderator: Mr_Noodle

So when I'm processing a file I create a folder name by using the filename of the file through AppleScript. Folder creation works flawlessly. However at times the folder created does not get processed further.

Code: Select all
make new folder at rootfolderLocation with properties {name:folderName}

ex. foldername = "hello."
all spaces are replaced with ".".. ex "hello world" > "hello.world" ex. "the hello world" > "the.hello.world"

Narrowing down the issue one thing I noticed:
- when you click rule status (eye in the hazel interface under the list of folder on that specific folder
- then select the "i" (on the specific folder)
- look at the detail information
1 the name and full name sometimes are different
2 the name is red (field is highlighted in red) and the full name isn't in red ( what does the red indicator mean?)

troubleshooting:
- went through the entire AppleScript and all steps check out as intended
- one thing I noticed. The difference between the name and full name usually at the "." ex. hello.world = name, hello = full name.
- Searching online sometimes the finder sometimes sees a trailing "." as a package. But this isn't true for all folders.
- if you manually select the folder and remove the trailing "." press enter then add it again then press return the folder name and full name become the same the reprocessing of the folder kicks in.

question:
- how would you create a folder that assures the name and full name are the same?
- what is the red highlighted of the full name mean?

thanks
united
 
Posts: 54
Joined: Wed Mar 14, 2012 3:48 pm

Full name is the name + the extension (the part after the dot) so you'll need to adjust your rules accordingly.

If the rule status shows a field as red, it means that your rule tried to match on that field and it didn't pass the condition.
Mr_Noodle
Site Admin
 
Posts: 11196
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Full name is the name + the extension (the part after the dot) so you'll need to adjust your rules accordingly.

If the rule status shows a field as red, it means that your rule tried to match on that field and it didn't pass the condition.



thanks for the reply. So why would the folder be created with a different full name and name? shouldn't both be the same or is it that since there are "." for spaces that it assumes it's an extension for some folders but not all?
united
 
Posts: 54
Joined: Wed Mar 14, 2012 3:48 pm

If there are any dots, there will be an extension.
Mr_Noodle
Site Admin
 
Posts: 11196
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

I'd say that would be true but there are other folders that have "." for space that are processed just fine while others have the red indicator mentioned above. So the behavior is mostly consistent but not 100%.

ALSO,

somethings i've noticed
- the folders that have an issue end with an "." at the end
- not all folders with a trailing "." have this issue
- the folders with this issue, the Name and Full Name attributes are different. Name has no trailing "." while the Full name does. The full name is the actual name of the folder. (unsure why these are not the same)

So trying to find consistency with the behavior.

what do you suggest? That doesn't involve changing the folder naming convention.
united
 
Posts: 54
Joined: Wed Mar 14, 2012 3:48 pm

As mentioned, the dot, no matter how you interpret is, is interpreted by the system as the start of an extension, namely the last dot and everything after it.

You should provide examples if you find the above doesn't hold true.
Mr_Noodle
Site Admin
 
Posts: 11196
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:As mentioned, the dot, no matter how you interpret is, is interpreted by the system as the start of an extension, namely the last dot and everything after it.

You should provide examples if you find the above doesn't hold true.



There is inconsistencies with this.

ex.
- a folder with a trailing "." "Folder." as the Full Name and Name as "Folder"
- now if you go to the that specific folder and edit the name to first to become "Folder" then re-edit the folder name to be "Folder." hazel then processes it as expected.

The issue is that it's not consistent in
- why it's processing some folders but not all
- when when you edit the folder and then re-edit the folder the folder processes as desired.
- why by re-editing the name does the full name and name now are identical as oppose to primary to that where the name was missing the trailing "."

that's the thing i'm trying to isolate
united
 
Posts: 54
Joined: Wed Mar 14, 2012 3:48 pm

Have you tried using Hazel's preview function whenever this happens? If so, please post the results of that, showing the values of Full Name and Name each time.
Mr_Noodle
Site Admin
 
Posts: 11196
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Have you tried using Hazel's preview function whenever this happens? If so, please post the results of that, showing the values of Full Name and Name each time.


Yes I have tried the preview function.

This is what I see:
- Name and Full name differ. The full name is the name of the folder in the finder.
- the difference is that the Name has no ending "." while the full name does.
- another difference is that the Name is in red.

Now if i manually change the full and remove the "." press enter then add the "." the rule processes as intended.

Image
united
 
Posts: 54
Joined: Wed Mar 14, 2012 3:48 pm

The red indicator means that the condition does not match and that is the field causing the problem.
Mr_Noodle
Site Admin
 
Posts: 11196
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:The red indicator means that the condition does not match and that is the field causing the problem.


Understood the red. But now what's the reason for the Full Name and Name to differ? Shouldn't they be the same? The other thing I noticed "Now if i manually change the full and remove the "." press enter then add the "." the rule processes as intended." then the name and full name are identical the rule is processed correctly.
united
 
Posts: 54
Joined: Wed Mar 14, 2012 3:48 pm

If there is a dot in the file, they will differ. That is by definition.
Mr_Noodle
Site Admin
 
Posts: 11196
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:If there is a dot in the file, they will differ. That is by definition.


Firstly, it's a folder not a file. Secondly, why would the name differ? If the finder shows the name to be with the trailing "." why does hazel see the "full name" different than the "name"? Also, why does this happen for some folder and not all folders?
united
 
Posts: 54
Joined: Wed Mar 14, 2012 3:48 pm

Image

I also I just created a folder manually and the same issue with the name being indicated in red and the rule not being processed on that same folder. This one was just command +shift+n for new folder.
united
 
Posts: 54
Joined: Wed Mar 14, 2012 3:48 pm

Folders are no different. I don't see why you are stuck on this point. Full Name and Name are different by definition in Hazel. If they were the same, then there'd be no reason to have both of them.
Mr_Noodle
Site Admin
 
Posts: 11196
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Next

Return to Support