boB Rudis
6 years ago
7 changed files with 50 additions and 0 deletions
@ -0,0 +1,8 @@ |
|||
# Generated by using Rcpp::compileAttributes() -> do not edit by hand |
|||
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 |
|||
|
|||
#' @export |
|||
resolve_alias <- function(path) { |
|||
.Call('_mactheknife_resolve_alias', PACKAGE = 'mactheknife', path) |
|||
} |
|||
|
@ -0,0 +1,22 @@ |
|||
#' Resolve macOS Alias Files to POSIX path strings |
|||
#' |
|||
#' @md |
|||
#' @param path path to the target alias |
|||
#' @return character vector |
|||
#' @export |
|||
resolve_alias <- function(path) { |
|||
|
|||
if (file.exists(path[1])) { |
|||
(applescript(sprintf(' |
|||
set myPosix to POSIX file "%s" |
|||
tell application "Finder" |
|||
set myPath to original item of item myPosix |
|||
end tell |
|||
set myPOSIXPath to POSIX path of (myPath as text) |
|||
return myPOSIXPath |
|||
', path.expand(path[1])))) |
|||
} else { |
|||
NULL |
|||
} |
|||
|
|||
} |
Binary file not shown.
@ -0,0 +1,17 @@ |
|||
% Generated by roxygen2: do not edit by hand |
|||
% Please edit documentation in R/resolve-alias.R |
|||
\name{resolve_alias} |
|||
\alias{resolve_alias} |
|||
\title{Resolve macOS Alias Files to POSIX path strings} |
|||
\usage{ |
|||
resolve_alias(path) |
|||
} |
|||
\arguments{ |
|||
\item{path}{path to the target alias} |
|||
} |
|||
\value{ |
|||
character vector |
|||
} |
|||
\description{ |
|||
Resolve macOS Alias Files to POSIX path strings |
|||
} |
Loading…
Reference in new issue