Skip to content

Commit 1a36032

Browse files
author
hhas
committed
bug fixes in File's ARGV parsing support
1 parent 567fdcd commit 1a36032

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

File.scptd/Contents/Resources/File.sdef

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ convert path theFile to file URL format <i>-- (a ‘from’ parameter isn't need
5454

5555

5656
<command name="normalize path" code="Fil:NorP" description="">
57-
<direct-parameter>
58-
<type type="text"/>
59-
</direct-parameter>
57+
<direct-parameter type="text"/>
6058
<parameter name="full expansion" code="ExpR" type="boolean" optional="yes" description="if true, relative paths will also be expanded to absolute paths within the current folder (default: false)"/>
6159
<result type="text"/>
6260

@@ -70,21 +68,21 @@ convert path theFile to file URL format <i>-- (a ‘from’ parameter isn't need
7068
normalize path "Music/iTunes" with full expansion
7169
→ "/Users/jsmith/Music/iTunes"</code></pre>
7270
73-
<p>A new path is made by performing the following operations:</p>
71+
<p>This command normalizes a path by performing the following clean-up tasks as needed:</p>
7472
7573
<ul>
76-
<li>Expanding an initial tilde expression.</li>
74+
<li>expanding the initial tilde expression</li>
7775
78-
<li>Removing an initial component of “/private/var/automount”, “/var/automount”, or “/private” from the path, if the result still indicates an existing file or folder (checked by consulting the file system).</li>
76+
<li>removing the initial component of “/private/var/automount”, “/var/automount”, or “/private” from the path, if the result still indicates an existing file or folder (checked by consulting the file system)</li>
7977
80-
<li>Reducing empty components and references to the current folder (that is, the sequences “//” and “/./”) to single path separators.</li>
78+
<li>reducing empty components and references to the current folder (that is, the sequences “//” and “/./”) to single path separators</li>
8179
82-
<li>Removing a trailing slash from the last component.</li>
83-
84-
<li>For absolute paths only, resolving references to the parent folder (that is, the component “..”) to the real parent folder if possible. For relative paths, references to the parent folder are left in place.</li>
80+
<li>removing the trailing slash from the last component.</li>
8581
</ul>
8682
87-
<p>Throws error number -1728 if the current working folder is unknown.</p>
83+
<p>For absolute paths, it also resolves references to the parent folder (that is, the component “..”) to the real parent folder if possible. For relative paths, references to the parent folder are left in place.</p>
84+
85+
<p>Note: this command will raise error number -1728 if a relative path is given and the current working directory is unknown.</p>
8886
]]></html>
8987
</documentation>
9088
</command>
4.54 KB
Binary file not shown.

unittests/file.unittest.scpt

14.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)