<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Search for filename in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Search-for-filename/m-p/276043#M53566</link>
    <description>&lt;P&gt;Thanks for the suggestion ih. I looked into this, but regret to say I'm not really knowledgeable enough on the Run Program command to make this work. At first glance, it appears to require an actual file in the "Executable" field, rather than just a string. This strays into unknown territory for me unfortunately.&lt;BR /&gt;&lt;BR /&gt;I've created a wish list item that is related to this:&amp;nbsp;&lt;LI-MESSAGE title="Possible to have an add-in search for a script and run it?" uid="276042" url="https://community.jmp.com/t5/JMP-Wish-List/Possible-to-have-an-add-in-search-for-a-script-and-run-it/m-p/276042#U276042" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-idea-thread lia-fa-icon lia-fa-idea lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I appreciated the questions at the end of your reply, and I tried to address those questions in this wishlist item post.&lt;BR /&gt;&lt;BR /&gt;Thanks again for you help.&lt;/P&gt;</description>
    <pubDate>Mon, 29 Jun 2020 17:31:23 GMT</pubDate>
    <dc:creator>nikles</dc:creator>
    <dc:date>2020-06-29T17:31:23Z</dc:date>
    <item>
      <title>Search for filename</title>
      <link>https://community.jmp.com/t5/Discussions/Search-for-filename/m-p/275513#M53462</link>
      <description>&lt;P&gt;Hi. &amp;nbsp;Is there a way to have a script search the user's computer for a given filename and return the path? &amp;nbsp;Im using a Mac and JMP14.3 atm. &amp;nbsp;I'm interested in creating an add-in that calls another script on the user's computer, but I won't know where the user has stored the script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the add-in, I'm thinking something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//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&amp;nbsp;I've&amp;nbsp;explored:

//Not&amp;nbsp;certain&amp;nbsp;what&amp;nbsp;the&amp;nbsp;"search"&amp;nbsp;option&amp;nbsp;does,&amp;nbsp;but&amp;nbsp;seemed&amp;nbsp;worth&amp;nbsp;a&amp;nbsp;go.&amp;nbsp;&amp;nbsp;
//This&amp;nbsp;only&amp;nbsp;returns&amp;nbsp;my&amp;nbsp;default&amp;nbsp;directory&amp;nbsp;with&amp;nbsp;"myscript.jsl"&amp;nbsp;appended&amp;nbsp;
//(even&amp;nbsp;though&amp;nbsp;there&amp;nbsp;is&amp;nbsp;no&amp;nbsp;such&amp;nbsp;file&amp;nbsp;in&amp;nbsp;that&amp;nbsp;location)

path = ConvertFilePath("myscript.jsl", search);&amp;nbsp;&amp;nbsp;

//There's&amp;nbsp;also&amp;nbsp;this, but same result as above:
Set&amp;nbsp;File&amp;nbsp;Search&amp;nbsp;Path("$HOME/");
path = ConvertFilePath("myscript.jsl", search);&amp;nbsp;&amp;nbsp;

//As a last resort,&amp;nbsp;I&amp;nbsp;looked&amp;nbsp;at&amp;nbsp;this,&amp;nbsp;thinking&amp;nbsp;maybe&amp;nbsp;if&amp;nbsp;I&amp;nbsp;could&amp;nbsp;get&amp;nbsp;a&amp;nbsp;list&amp;nbsp;of&amp;nbsp;all&amp;nbsp;files,&amp;nbsp;
//I&amp;nbsp;could&amp;nbsp;then&amp;nbsp;search&amp;nbsp;the&amp;nbsp;list&amp;nbsp;for&amp;nbsp;myscript.jsl.&amp;nbsp;&amp;nbsp;Unfortunately&amp;nbsp;I&amp;nbsp;cannot&amp;nbsp;get&amp;nbsp;the&amp;nbsp;"recursive"&amp;nbsp;
//option&amp;nbsp;to&amp;nbsp;work&amp;nbsp;on&amp;nbsp;my&amp;nbsp;machine&amp;nbsp;(Mac,&amp;nbsp;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.

&lt;/CODE&gt;y = Files In Directory("$HOME", "recursive"); //Returns {}&lt;BR /&gt;y = Files In Directory("$HOME", "Recursive"); //Returns {}&lt;BR /&gt;y = Files In Directory("$HOME", recursive); //Returns {}&lt;BR /&gt;y = Files In Directory("$HOME", Recursive); //Returns {}&lt;BR /&gt;y = Files In Directory("$HOME", Recursive(1)); //Returns {}&lt;BR /&gt;&lt;BR /&gt;//All options above just return {}. I'm curious if this is unique to my setup (Mac, JMP14.3).&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;Other than that, I'm out of ideas. &amp;nbsp;Does anyone have any suggestions? &amp;nbsp;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:30:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Search-for-filename/m-p/275513#M53462</guid>
      <dc:creator>nikles</dc:creator>
      <dc:date>2023-06-09T23:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: Search for filename</title>
      <link>https://community.jmp.com/t5/Discussions/Search-for-filename/m-p/275552#M53471</link>
      <description>&lt;P&gt;If you need to search the whole drive you likely want to leverage any indexing the OS already did, which I&amp;nbsp;&lt;EM&gt;think&lt;/EM&gt; is possible using 'find' in the terminal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;find / -name abc.dmg&lt;/PRE&gt;&lt;P&gt;You could call this using Run Program.&amp;nbsp; I am guessing at the file path for find and the syntax, but the call might look something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Run Program(
	Executable( "/usr/bin/find"),
	options( {"/ -name abc.dmg"} )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Some other things to consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Could you include the script in your add-in?&lt;/LI&gt;&lt;LI&gt;This is probably going to be slow, would it be faster to just ask the user to open the file?&lt;/LI&gt;&lt;LI&gt;If the user does pick the file, you could save the path and not ask on subsequent runs, or you could copy the file to the add-in folder.&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Fri, 26 Jun 2020 11:51:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Search-for-filename/m-p/275552#M53471</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2020-06-26T11:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: Search for filename</title>
      <link>https://community.jmp.com/t5/Discussions/Search-for-filename/m-p/276043#M53566</link>
      <description>&lt;P&gt;Thanks for the suggestion ih. I looked into this, but regret to say I'm not really knowledgeable enough on the Run Program command to make this work. At first glance, it appears to require an actual file in the "Executable" field, rather than just a string. This strays into unknown territory for me unfortunately.&lt;BR /&gt;&lt;BR /&gt;I've created a wish list item that is related to this:&amp;nbsp;&lt;LI-MESSAGE title="Possible to have an add-in search for a script and run it?" uid="276042" url="https://community.jmp.com/t5/JMP-Wish-List/Possible-to-have-an-add-in-search-for-a-script-and-run-it/m-p/276042#U276042" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-idea-thread lia-fa-icon lia-fa-idea lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I appreciated the questions at the end of your reply, and I tried to address those questions in this wishlist item post.&lt;BR /&gt;&lt;BR /&gt;Thanks again for you help.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2020 17:31:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Search-for-filename/m-p/276043#M53566</guid>
      <dc:creator>nikles</dc:creator>
      <dc:date>2020-06-29T17:31:23Z</dc:date>
    </item>
  </channel>
</rss>

