Page 1 of 2

AppleScript creating new folder name and display differ

PostPosted: Fri May 10, 2019 1:19 pm
by united
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

Re: AppleScript creating new folder name and display differ

PostPosted: Mon May 13, 2019 11:16 am
by Mr_Noodle
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.

Re: AppleScript creating new folder name and display differ

PostPosted: Thu May 16, 2019 3:32 am
by united
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?

Re: AppleScript creating new folder name and display differ

PostPosted: Thu May 16, 2019 10:41 am
by Mr_Noodle
If there are any dots, there will be an extension.

Re: AppleScript creating new folder name and display differ

PostPosted: Sat May 18, 2019 6:06 pm
by united
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.

Re: AppleScript creating new folder name and display differ

PostPosted: Mon May 20, 2019 10:44 am
by Mr_Noodle
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.

Re: AppleScript creating new folder name and display differ

PostPosted: Fri Jul 12, 2019 6:16 am
by united
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

Re: AppleScript creating new folder name and display differ

PostPosted: Fri Jul 12, 2019 10:38 am
by Mr_Noodle
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.

Re: AppleScript creating new folder name and display differ

PostPosted: Fri Aug 16, 2019 2:07 am
by united
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

Re: AppleScript creating new folder name and display differ

PostPosted: Fri Aug 16, 2019 10:15 am
by Mr_Noodle
The red indicator means that the condition does not match and that is the field causing the problem.

Re: AppleScript creating new folder name and display differ

PostPosted: Fri Aug 16, 2019 10:51 am
by united
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.

Re: AppleScript creating new folder name and display differ

PostPosted: Mon Aug 19, 2019 9:50 am
by Mr_Noodle
If there is a dot in the file, they will differ. That is by definition.

Re: AppleScript creating new folder name and display differ

PostPosted: Mon Aug 19, 2019 3:42 pm
by united
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?

Re: AppleScript creating new folder name and display differ

PostPosted: Mon Aug 19, 2019 4:08 pm
by united
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.

Re: AppleScript creating new folder name and display differ

PostPosted: Tue Aug 20, 2019 10:07 am
by Mr_Noodle
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.