Re: Jon's commands renameFile not working?
Re: Jon's commands renameFile not working?
- Subject: Re: Jon's commands renameFile not working?
- From: Emmanuel LEVY <email@hidden>
- Date: Thu, 11 Mar 2010 12:50:16 +0100
Considering the overwhelming number of requests that we received, it's
better that we post the osax here.
If you use the osax, do report bugs, please.
Emmanuel
Attachment:
Files.osax.zip
Description: Zip archive
On Mar 11, 2010, at 12:52 AM, Emmanuel LEVY wrote:
In an access of unreasonable bounty, we Satimage-software are ready
to give a limited amount of copies of our outstanding Files.osax,
under feedbackware license terms, on a first-come, first-served
basis. Only the first 200.000 requests will be served. Files.osax
includes filerename, a possible replacement for Jon's Commands'
renameFile command.
Below the late-breaking dictionary of that famous piece of software.
Emmanuel
Files and folders suite
In this dictionary, alias must be understood as alias or posix path
or url.
filenew v : create a new empty file, fail if already exists.
filenew alias : the destination folder, or a file path.
name string : the file name. If the name parameter is not provided,
the direct parameter is considered as the destination file path.
→ alias : the new file
mkdir v : create a new folder.
mkdir alias : a folder path
[name string] : a relative url
→ alias : the new folder
openfork v : .
openfork file : a file path
permission integer : 1 read, 2 write, 16 deny read, 32 deny write
[timeout real]
→ integer
openfd v : .
openfd file : a file path
permission integer : read 1, write 2, not blocking 4, append 8,
exclusive file lock 32, synchronous writes 128
[timeout real]
→ integer
setposfork v : .
setposfork integer : a file refnum
[mode integer] : fsFromStart 1, fsFromLEOF 2, fsFromMark 3.Default 1
offset real
closefork v : .
closefork integer : a file refnum
closefd v : .
closefd integer : a file refnum
flushfork v : .
flushfork integer : a file refnum
filelock v : given a file, attempt to create or update an
associated .lock file by appending '.lock' to the original name. An
expiration delay is stored in the .lock file. filelock fails if
the .lock file already exists and is still valid.
filelock alias : the file to lock.
[timeout real] : the expiration delay in seconds. Default: no timeout
→ alias : the .lock file.
The following error numbers are specific to the locking process:
• -3 a still valid .lock file already exists. The partial result
of the error contains the remaining expiration delay,
• -4 can't create the .lock file,
• -5 can't write the .lock file,
• -6 can't read the .lock file,
• -7 unknown file format.
filelockinfo v : return info for a .lock file
filelockinfo alias : the .lock file
→ record
filecopy v : copy a file synchronously
filecopy alias or list of alias : the file(s) to copy
[from alias] : the base url. Relevant if direct parameter is a
string or a list of strings.
[to alias] : the destination folder. Required unless the "filepath"
parameter is specified
[name string] : the new file name (when using the "to" parameter).
Not allowed if the direct parameter is a list. Default: the original
file name
[filepath file specification] : an alternative to the use of the
"to" and "name" parameters: the destination file path. Not allowed
if the direct parameter is a list
[into file specification] : for backward compatibility. Same as as
filepath.
[replacing boolean] : allow to replace an existing item. Default:
false
→ alias : the copied file
filemove v : move a file synchronously
filemove alias or list of alias : the file(s) to move
[from alias] : the base url. Relevant if direct parameter is a
string or a list of strings.
[to alias] : the destination folder. Required unless the "filepath"
parameter is specified
[name string] : the new file name (when using the "to" parameter).
Not allowed if the direct parameter is a list. Default: the old file
name
[filepath file specification] : an alternative to the use of the
"to" and "name" parameters: the destination file path. Not allowed
if the direct parameter is a list
[into file specification] : for backward compatibility. Same as as
filepath.
[replacing boolean] : allow to replace an existing item. Default:
false
→ alias : the copied file
fileremove v : remove a file synchronously
fileremove alias or list of alias : the file(s) or folder(s) to remove
[from alias] : the base url. Relevant if direct parameter is a
string or a list of strings.
[filesonly boolean] : False : delete the item(s) of direct
parameter. True : delete only files and handle a folder in the
direct parameters as the list of its files. Default: false
[after date] : allowed only with filesonly true
[before date] : allowed only with filesonly true
[locked files boolean] : if true, remove also locked files. Default
true
[busy files boolean] : if true, remove also busy files. Default true
fileunlink v : remove a single file synchronously (this command do
not remove folders)
fileunlink alias : the file to remove
create symlink v : create a symlink
create symlink alias : the target of the new symlink. Can be an
alias or a string (a valid posix path, not quoted, without space.)
in alias : the folder where to create the symlink
[name string] : the new file name. Default: the name of the
symlink's target
[replacing boolean] : allow to replace an existing symlink. Default:
true
testsymlink v : return true if the direct parameter is a symlink,
false otherwise
testsymlink alias or string : in case of an alias, the symlink will
be resolved: prefer providing an url or an unix path.
→ boolean
<triangle_closed.png> Example
filegetname v : returns the name of a file
filegetname alias or list of alias
→ string : the file name
filerename v : rename a file
filerename alias
to string : the new file name.
→ alias : the renamed file
flush volume v : flush the volume relative to the direct parameter
flush volume alias : a file reference
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden