안녕하세요. 스크립트가 사용자의 컴퓨터에서 주어진 파일 이름을 검색하고 경로를 반환하도록하는 방법이 있습니까? Mac과 JMP14.3 atm을 사용하고 있습니다. 사용자 컴퓨터에서 다른 스크립트를 호출하는 추가 기능을 만드는 데 관심이 있지만 사용자가 스크립트를 저장 한 위치는 알 수 없습니다.
추가 기능에서 다음과 같이 생각합니다.
y = Files In Directory("$HOME", "recursive"); //Returns {}
y = Files In Directory("$HOME", "Recursive"); //Returns {}
y = Files In Directory("$HOME", recursive); //Returns {}
y = Files In Directory("$HOME", Recursive); //Returns {}
y = Files In Directory("$HOME", Recursive(1)); //Returns {}
//All options above just return {}. I'm curious if this is unique to my setup (Mac, JMP14.3).
//Add-in code
path = [command or function to search for "myscript.jsl" on user's computer and return a path];
Include(path, New Context);
//Things I've explored:
//Not certain what the "search" option does, but seemed worth a go.
//This only returns my default directory with "myscript.jsl" appended
//(even though there is no such file in that location)
path = ConvertFilePath("myscript.jsl", search);
//There's also this, but same result as above:
Set File Search Path("$HOME/");
path = ConvertFilePath("myscript.jsl", search);
//As a last resort, I looked at this, thinking maybe if I could get a list of all files,
//I could then search the list for myscript.jsl. Unfortunately I cannot get the "recursive"
//option to work on my machine (Mac, JMP14.3). I imagine this would be a very slow method
//though as there are 1000s of files in a typical user's home directory.
그 외에는 아이디어가 없습니다. 누구든지 제안이 있습니까? 감사.
전체 드라이브를 검색 해야하는 경우 이미 수행 한 OS를 인덱싱하고 싶을 것입니다. 생각한다 터미널에서 '찾기'를 사용하여 가능합니다.
find / -name abc.dmg
Run Program을 사용하여 이것을 호출 할 수 있습니다. find와 구문에 대한 파일 경로를 추측하지만 호출은 다음과 같습니다.
Run Program(
Executable( "/usr/bin/find"),
options( {"/ -name abc.dmg"} )
);고려해야 할 몇 가지 사항 :
- 추가 기능에 스크립트를 포함시킬 수 있습니까?
- 아마도 느릴 것입니다. 사용자에게 파일을 열도록 요청하는 것이 더 빠를까요?
- 사용자가 파일을 선택하면 경로를 저장하고 후속 실행을 요구하지 않거나 파일을 추가 기능 폴더에 복사 할 수 있습니다.
제안 ih에 감사드립니다. 나는 이것을 조사했지만,이 프로그램을 실행하기 위해 프로그램 실행 명령에 대해 충분히 지식이 충분하지 않다는 것을 유감스럽게 생각합니다. 언뜻보기에는 문자열이 아닌 "실행 파일"필드에 실제 파일이 필요한 것으로 보입니다. 이것은 불행히도 나를 위해 알 수없는 영역으로 빠져 나옵니다.
이와 관련된 희망 목록 항목을 만들었습니다. 추가 기능으로 스크립트를 검색하고 실행할 수 있습니까?
회신이 끝났을 때 질문에 감사 드리며이 위시리스트 항목 게시물에서 해당 질문을 해결하려고했습니다.
도와 주셔서 다시 한 번 감사드립니다.