Re: Getting Finder results into LiveCode

2016-01-13 Thread Francis Nugent Dixon
Hi from Beautiful Brittany,

Thanks to all for your responses, especially to Martin Koob and
Klaus Major. I have all I need. I had tinkered with the idea of using
AppleScript, but apart from simple scripts, I find AppleScript
excessively impenetrable, even after 50 years of programming
in many languages .

To clarify my apparent disorder in having multiple copies of some files,
iTunes Libraries, iPhoto Libraries, , etc., on FIVE different Macs. I will
explain why I needed precise responses to my questions.
I move around my multiple copies, on external disks, from my master
data bases on Computer 1, to my other computers for use by others.
Every so often, I mount all my external disks onto Computer 1, and now
need to know which data base copies are out of sync, sync them, and
then put them back in circulation on the other computers. When my kids
and grandkids come to visit, they can access mirror copies of my master
computer (and screw them up if they want), not impacting my data bases.

But I also want to access Finder information for other motives, and so I
used this specific example to define my problem. In this instance, whether
I will have problems getting the info from all of my external disks, and then
syncing all the file copies, is an obstacle I will overcome when I get to it.

And because I program every waking day, and often look for complicated
solutions to strange requirements, often trashing results which do not
do what I want, is not a problem. I program in LiveCode because I love
programming. Whether I get apps which work is not a prerequisite !!

Thanks again !

-Francis

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting Finder results into LiveCode

2016-01-13 Thread Kay C Lan
On Thu, Jan 14, 2016 at 12:44 AM, Peter M. Brigham  wrote:
>
>
> > Plus a whole lot more.
>
> for instance, summon Alfred, type ">"  then enter a shell command, and it
> sends the command to Terminal. \


Oh, now you're talking! I love the way I can look up a Dictionary
definition or do a quick arithmetic calculation in Spotlight. Use it
constantly. Spotlight can't send Terminal commands, and that is a feature I
could get use to very quickly!

Of course in Terminal you can carry out a Spotlight style search by using
mdfind with the big difference that instead of being limited to the top 20
or 30 most relevant hits, you get everything. And if you want file paths,
you've got them.

mdfind livecode

mdfind -count livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting Finder results into LiveCode

2016-01-13 Thread Peter M. Brigham
On Jan 13, 2016, at 12:21 AM, Kay C Lan wrote:

> On Wed, Jan 13, 2016 at 4:39 AM, Peter M. Brigham  wrote:
> 
>> I use a utility called Alfred on my Mac...
> 
> 
> 
>> It allows you to search for files whose name contain , and also
>> allows you to search for files whose contents contain .
> 
> 
> This is the default way Spotlight works, it searches both for name or
> content. If you want to restrict to content only:
> 
> intext:livecode revolution metacard
> 
> This will find any document that contains all three words
> 
> livecode OR revolution OR metacard
> 
> This will find any file whose name or content contains either of the words
> listed.
> 
> I only get one hit for the first seach: LiveCode Mobile Development
> Beginner's Guide [eBook].pdf
> 
> 
>> Plus it allows hotkeys for launching apps or files,
> 
> 
> What is your hotkey for Skype and Safari? I type cmd+spacebar s return and
> Skype is up and running. I type cmd+spacebar sa return and Safari starts.
> cmd+s is already taken so you can't be saving too many key strokes ;-)
> 
> Once any file is found and hilited in Spotlight pressing Return will open
> it in it's default Application.

With Alfred, you can assign any document or app any free hotkey. I use 
control-option- for all launching shortcuts, and I have a shortcut for all 
my frequently used LC stacks, as well as for a few other documents.

> and a clipboard with memory -- see a list of the past 40 or 50 pieces of
>> text you've copied and insert the one you want with a keypress.
> 
> 
> Yes that is a very very useful feature.

I use it all the time

> Plus a whole lot more.

for instance, summon Alfred, type ">"  then enter a shell command, and it sends 
the command to Terminal. Control iTunes as well.

> To learn more about Alfred I Googled Alfred vs Spotlight and came up with
> this website:
> 
> https://www.quora
> .com/Will-the-new-Spotlight-in-OS-X-Yosemite-replace-Alfred?share=1
> 
> Which had this rather interesting list:
> 
> These are some of the extra things Alfred has:
>>Alfred can close apps with the Quit  command.
>>Alfred can find a file and reveal it in finder with Find 
>> command.
>>Alfred can search Google, Yahoo, Wikipedia.
>>Alfred can set limit for the search.
>>Alfred can open URLs in browser.
>>Alfred can Shutdown, Sleep and Restart a Mac.
> 
> 
> I use cmd+q to Quit an app. Seems a lot quicker than typing: quit appname

Yeah, never use this, seems superfluous

> If a folder or file is hilited in Spotlight cmd+r will open a new finder
> window and reveal it's locations, no special Find command required.
> 
> Spotlight only searches Google and Wikipedia, not Yahoo, or DuckDuckGo
> which is my browser's default search engine.
> 
> Not sure what 'limit for the search' means. If I want just apps, or just
> folders, or just movies I can specify that.
> 
> If a URL exists in your bookmarks or history or an entry you've placed into
> a search engine, then typing this into Spotlight will get hits under the
> 'Web Page' category and clicking on any of these will open the page in your
> default web browser. If it's an unknown web address I'm not sure why you'd
> be typing it into Alfred and not simply typing it into your browser?
> 
> No, Spotlight can't Shutdown, Restart or Sleep my Mac.
> 
>> I like the user interface
> 
> And really that's all that matters. If you are more productive because
> it's interface suits you better then that's all that counts. I mention
> these things not in an attempt to dissuade you from doing what you are
> doing but for others who may not appreciate what Spotlight can do for them;
> or have been given incorrect information as to what Spotlight can do.

Right. It's all about what comes naturally to the individual user.

Actually, if Alfred didn't exist, I'd do fine with just using Spotlight, except 
for the clipboard history function, which I use constantly, eg, copying 
multiple LC fields, then going to another card/stack and pasting them one by 
one -- no constant back-and-forth. And I like the launching shortcuts.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting Finder results into LiveCode

2016-01-13 Thread Kay C Lan
On Wed, Jan 13, 2016 at 8:55 PM, Francis Nugent Dixon 
wrote:

> I love
> programming. Whether I get apps which work is not a prerequisite !!
>
> Brilliant! Made me smile from ear to ear... it's going to be a good day:-)
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting Finder results into LiveCode

2016-01-12 Thread Kay C Lan
On Wed, Jan 13, 2016 at 4:39 AM, Peter M. Brigham  wrote:

> I use a utility called Alfred on my Mac...



> It allows you to search for files whose name contain , and also
> allows you to search for files whose contents contain .


This is the default way Spotlight works, it searches both for name or
content. If you want to restrict to content only:

intext:livecode revolution metacard

This will find any document that contains all three words

livecode OR revolution OR metacard

This will find any file whose name or content contains either of the words
listed.

I only get one hit for the first seach: LiveCode Mobile Development
Beginner's Guide [eBook].pdf


> Plus it allows hotkeys for launching apps or files,


What is your hotkey for Skype and Safari? I type cmd+spacebar s return and
Skype is up and running. I type cmd+spacebar sa return and Safari starts.
cmd+s is already taken so you can't be saving too many key strokes ;-)

Once any file is found and hilited in Spotlight pressing Return will open
it in it's default Application.


> and a clipboard with memory -- see a list of the past 40 or 50 pieces of
> text you've copied and insert the one you want with a keypress.


Yes that is a very very useful feature.


> Plus a whole lot more.
>

To learn more about Alfred I Googled Alfred vs Spotlight and came up with
this website:

https://www.quora
.com/Will-the-new-Spotlight-in-OS-X-Yosemite-replace-Alfred?share=1

Which had this rather interesting list:

These are some of the extra things Alfred has:
> Alfred can close apps with the Quit  command.
> Alfred can find a file and reveal it in finder with Find 
> command.
> Alfred can search Google, Yahoo, Wikipedia.
> Alfred can set limit for the search.
> Alfred can open URLs in browser.
> Alfred can Shutdown, Sleep and Restart a Mac.


I use cmd+q to Quit an app. Seems a lot quicker than typing: quit appname

If a folder or file is hilited in Spotlight cmd+r will open a new finder
window and reveal it's locations, no special Find command required.

Spotlight only searches Google and Wikipedia, not Yahoo, or DuckDuckGo
which is my browser's default search engine.

Not sure what 'limit for the search' means. If I want just apps, or just
folders, or just movies I can specify that.

If a URL exists in your bookmarks or history or an entry you've placed into
a search engine, then typing this into Spotlight will get hits under the
'Web Page' category and clicking on any of these will open the page in your
default web browser. If it's an unknown web address I'm not sure why you'd
be typing it into Alfred and not simply typing it into your browser?

No, Spotlight can't Shutdown, Restart or Sleep my Mac.

>
> I like the user interface
>
> And really that's all that matters. If you are more productive because
it's interface suits you better then that's all that counts. I mention
these things not in an attempt to dissuade you from doing what you are
doing but for others who may not appreciate what Spotlight can do for them;
or have been given incorrect information as to what Spotlight can do.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting Finder results into LiveCode

2016-01-12 Thread Dr. Hawkins
On Tue, Jan 12, 2016 at 5:50 PM, Kay C Lan  wrote:

> Have you changed the default keyboard shortcuts for anything ?
>

Now I see it.

How unapplish.

There at the bottom of the document, in the same colors as the document
(white on black).

I do change my settings to put the control key where God Meant it to be,
but aside from that, I pretty much leave things alone.

Now, if I could get X's cut and paste, or true focus follows mouse . . . I
had to give those up to get spotlight, and I still miss them :(


-- 
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting Finder results into LiveCode

2016-01-12 Thread Kay C Lan
On Tue, Jan 12, 2016 at 1:45 PM, J. Landman Gay 
wrote:

> Every build I do is in a named folder with all build files inside,
> including the LiveCode source stack. I end up with dozens of source stacks
> with the same names.
>
> Ahh, now I understand why the path is so important to you.


> If you haven't done a Finder search lately, try this:
>
> ...but if you choose "Other" you can add more filters by selecting them.


I venture into the Finder's search window whenever I'm looking for the
proverbial needle, ie a Pages, rtf or text document created the summer of
'09, or was it '08 which is at least 8 pages long but less than 15 - no
idea of the name but the content would have included the word 'cheese'.
That's all way too hard to type into Spotlight!

Spotlight, great when you know exactly what you are looking for, Finder
search perfect when you need to collect, filter, sort, pick and choose.


if you write a Spotlight plugin for your Back to the Future stack we'll all

be able to do a Spotlight search for the Stacks we are going to create

'next week'. :-)

Now that I can certainly do. I will have done it, in fact.
>

date:next week

Ah yes Spotlight tells me I have a reminder to thank you yesterday for the
stack you created today based on work you start tomorrow ;-)
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting Finder results into LiveCode

2016-01-12 Thread Peter M. Brigham
Thanks.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig

On Jan 12, 2016, at 11:00 AM, Klaus major-k wrote:

> Hi Peter,
> 
>> Am 12.01.2016 um 16:50 schrieb Peter M. Brigham :
>> 
>> mdls doesn't like spaces in the file path. What do I do to escape spaces 
>> here?
> 
> Just QUOTE it:
> …
> put shell( "mdls" && QUOTE & tFilepath & QUOTE) into tFileInfo 
> …
> 
>> -- Peter
>> 
>> Peter M. Brigham
>> pmb...@gmail.com
>> http://home.comcast.net/~pmbrig
> 
> Best
> 
> Klaus
> 
> --
> Klaus Major
> http://www.major-k.de
> kl...@major-k.de
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting Finder results into LiveCode

2016-01-12 Thread Peter M. Brigham
Right, I found on a google search that single quotes are safer than double 
quotes.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig

On Jan 12, 2016, at 11:33 AM, Dr. Hawkins wrote:

> On Tue, Jan 12, 2016 at 8:00 AM, Klaus major-k  wrote:
> 
>> Hi Peter,
>> 
>>> Am 12.01.2016 um 16:50 schrieb Peter M. Brigham :
>>> 
>>> mdls doesn't like spaces in the file path. What do I do to escape spaces
>> here?
>> 
>> Just QUOTE it:
>> …
>> put shell( "mdls" && QUOTE & tFilepath & QUOTE) into tFileInfo
>> 
> 
> using double quotes can cause variable substitution in the shell.  Instead,
> 
> put shell( "mdld '" & tFilepath "'") into tFileInfo
> 
> 
> will dom it without risking any substitution.
> 
> And backticks (`) will cause anything inside them to be evaluated as a
> command
> 
> -- 
> Dr. Richard E. Hawkins, Esq.
> (702) 508-8462
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting Finder results into LiveCode

2016-01-12 Thread Peter M. Brigham
I use a utility called Alfred on my Mac. I believe it uses Spotlight but I like 
the user interface. It allows you to search for files whose name contain 
, and also allows you to search for files whose contents contain 
. Plus it allows hotkeys for launching apps or files, and a clipboard 
with memory -- see a list of the past 40 or 50 pieces of text you've copied and 
insert the one you want with a keypress. Plus a whole lot more. And the basic 
app is free.

"Alfred" like the butler in Batman….

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig

On Jan 12, 2016, at 7:24 AM, Kay C Lan wrote:

> On Tue, Jan 12, 2016 at 1:45 PM, J. Landman Gay 
> wrote:
> 
>> Every build I do is in a named folder with all build files inside,
>> including the LiveCode source stack. I end up with dozens of source stacks
>> with the same names.
>> 
>> Ahh, now I understand why the path is so important to you.
> 
> 
>> If you haven't done a Finder search lately, try this:
>> 
>> ...but if you choose "Other" you can add more filters by selecting them.
> 
> 
> I venture into the Finder's search window whenever I'm looking for the
> proverbial needle, ie a Pages, rtf or text document created the summer of
> '09, or was it '08 which is at least 8 pages long but less than 15 - no
> idea of the name but the content would have included the word 'cheese'.
> That's all way too hard to type into Spotlight!
> 
> Spotlight, great when you know exactly what you are looking for, Finder
> search perfect when you need to collect, filter, sort, pick and choose.
> 
> 
> if you write a Spotlight plugin for your Back to the Future stack we'll all
> 
> be able to do a Spotlight search for the Stacks we are going to create
> 
> 'next week'. :-)
> 
> Now that I can certainly do. I will have done it, in fact.
>> 
> 
> date:next week
> 
> Ah yes Spotlight tells me I have a reminder to thank you yesterday for the
> stack you created today based on work you start tomorrow ;-)
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting Finder results into LiveCode

2016-01-12 Thread Peter M. Brigham
mdls doesn't like spaces in the file path. What do I do to escape spaces here?

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig

On Jan 11, 2016, at 9:48 AM, Martin Koob wrote:

> Any time I see "can you get this info on a Mac" I head for the shell.
> 
> I found the following for a terminal command to get file info.
> 
> http://apple.stackexchange.com/questions/165095/is-there-a-similar-functionality-of-get-info-cmdi-from-the-mac-os-x-termina
> 
> So it says use the mdls command
> 
> So then I put it in a shell function in a LiveCode Script.
> 
> http://apple.stackexchange.com/questions/165095/is-there-a-similar-functionality-of-get-info-cmdi-from-the-mac-os-x-termina
> 
> on mouseUp
>   answer File "Select file to get info on..."
>   put it into tFilePath
>   put shell( "mdls" && tFilepath) into tFileInfo
>   put tFileInfo into field 1
> end mouseUp
> 
> Then you get the following data in tFileInfo that you would then parse for
> the data you want.
> 
> ---
> kMDItemAlternateNames  = (
>"MyFile.rtf"
> )
> kMDItemContentCreationDate = 2016-01-11 15:04:45 +
> kMDItemContentModificationDate = 2016-01-11 15:04:45 +
> kMDItemContentType = "public.rtf"
> kMDItemContentTypeTree = (
>"public.rtf",
>"public.text",
>"public.data",
>"public.item",
>"public.content"
> )
> kMDItemDateAdded   = 2016-01-11 15:04:45 +
> kMDItemDisplayName = "MyFile"
> kMDItemFSContentChangeDate = 2016-01-11 15:04:45 +
> kMDItemFSCreationDate  = 2016-01-11 15:04:45 +
> kMDItemFSCreatorCode   = ""
> kMDItemFSFinderFlags   = 16
> kMDItemFSHasCustomIcon = (null)
> kMDItemFSInvisible = 0
> kMDItemFSIsExtensionHidden = 1
> kMDItemFSIsStationery  = (null)
> kMDItemFSLabel = 0
> kMDItemFSName  = "MyFile.rtf"
> kMDItemFSNodeCount = (null)
> kMDItemFSOwnerGroupID  = 20
> kMDItemFSOwnerUserID   = 501
> kMDItemFSSize  = 332
> kMDItemFSTypeCode  = ""
> kMDItemKind= "Rich Text Document"
> kMDItemLastUsedDate= 2016-01-11 15:04:45 +
> kMDItemLogicalSize = 332
> kMDItemPhysicalSize= 4096
> kMDItemUseCount= 1
> kMDItemUsedDates   = (
>"2016-01-11 05:00:00 +"
> )
> -
> 
> 
> Martin
> 
> 
> 
> --
> View this message in context: 
> http://runtime-revolution.278305.n4.nabble.com/Getting-Finder-results-into-LiveCode-tp4700069p4700072.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting Finder results into LiveCode

2016-01-12 Thread Kay C Lan
On Wed, Jan 13, 2016 at 12:30 AM, Dr. Hawkins  wrote:

>
> I can't get either to work in El Capitan . . .
>

This seems to suggest it's the same as Yosemite (cmd+option is for
mavericks and prior)

https://support.apple.com/kb/PH21907?viewlocale=en_US=en_US

Have you changed the default keyboard shortcuts for anything ?

And for Jacque, the cmd + option + spacebar might be of interest to you. No
mousing around, straight to your favourite search window ready to go.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting Finder results into LiveCode

2016-01-12 Thread Dr. Hawkins
On Tue, Jan 12, 2016 at 8:00 AM, Klaus major-k  wrote:

> Hi Peter,
>
> > Am 12.01.2016 um 16:50 schrieb Peter M. Brigham :
> >
> > mdls doesn't like spaces in the file path. What do I do to escape spaces
> here?
>
> Just QUOTE it:
> …
> put shell( "mdls" && QUOTE & tFilepath & QUOTE) into tFileInfo
>

using double quotes can cause variable substitution in the shell.  Instead,

put shell( "mdld '" & tFilepath "'") into tFileInfo


will dom it without risking any substitution.

And backticks (`) will cause anything inside them to be evaluated as a
command

-- 
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Getting Finder results into LiveCode

2016-01-12 Thread Dr. Hawkins
On Mon, Jan 11, 2016 at 9:45 PM, J. Landman Gay 
wrote:

> On 1/11/2016 10:37 PM, Kay C Lan wrote:
>
>> Unfortunately it involves using the mouse but if you press the Option +
>> cmd
>> keys whilst mousing over any Spotlight result Quicklook should pop-up and
>> at the bottom is the file path - which may be truncated depending on how
>> many folders deep it is buried.
>>
>
> Good to know, thanks. It seems that only the Cmd key is necessary to show
> a path, at least in Yosemite, and the target line has to be selected. Long
> paths are truncated, but probably good enough to identify the item.
>

I can't get either to work in El Capitan . . .




-- 
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting Finder results into LiveCode

2016-01-11 Thread J. Landman Gay

On 1/11/2016 10:37 PM, Kay C Lan wrote:

Unfortunately it involves using the mouse but if you press the Option + cmd
keys whilst mousing over any Spotlight result Quicklook should pop-up and
at the bottom is the file path - which may be truncated depending on how
many folders deep it is buried.


Good to know, thanks. It seems that only the Cmd key is necessary to 
show a path, at least in Yosemite, and the target line has to be 
selected. Long paths are truncated, but probably good enough to identify 
the item.



I think Labels are now called Tags


Sorry, I was linguistically sloppy, though the info you gave is a useful 
addedum. I didn't really mean "tags", I meant labelled (i.e.: named) 
folders. Every build I do is in a named folder with all build files 
inside, including the LiveCode source stack. I end up with dozens of 
source stacks with the same names.


If you haven't done a Finder search lately, try this:

Open any Finder window. If you know the general location of the files 
you want, open the window at that folder; the search will start at the 
current window's location and drill down from there. Type Cmd-F. Enter a 
search term in the find box. The default is to search file names and 
content, but you can change it to only match file names in the dropdown 
that appears under the search term.


Above the results list that appears, you can filter by any of dozens of 
filters. Common ones are already in the dropdown menu, but if you choose 
"Other" you can add more filters by selecting them. If you use certain 
filters frequently you can add them to the default menu by ticking their 
checkbox.


You'll get a list of exactly what you're looking for, and all file 
attributes normally displayed in your Finder view are immediately available.



if you write a Spotlight plugin for your Back to the Future stack we'll all
be able to do a Spotlight search for the Stacks we are going to create
'next week'. :-)


Now that I can certainly do. I will have done it, in fact.

Now we both have new ways to find things.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting Finder results into LiveCode

2016-01-11 Thread Kay C Lan
Straying off topic,

On Mon, Jan 11, 2016 at 11:32 PM, J. Landman Gay 
wrote:

> I'd use Spotlight more too if it would show the file path to each of
> duplicate copies of a file.


Unfortunately it involves using the mouse but if you press the Option + cmd
keys whilst mousing over any Spotlight result Quicklook should pop-up and
at the bottom is the file path - which may be truncated depending on how
many folders deep it is buried.

If a duplicate file resides on another HD then the name of the HD will
appear in faint gray to the right of the name.


> I often have a master copy and a duplicate in a shared dropbox folder, as
> well as multiple historical copies in labelled folders, and I need to know
> which copy I'm about to open.
>
> I think Labels are now called Tags, make sure all your Tags start with a
different letter; Top Priority, Original, Backup, Archive etc. Tag your
originals and backups appropriately, then in Spotlight

tag:o .li
tag:o .pd
tag:o .tx

 --gets all your original livecode stacks, pdfs or txt documents.

tag:b canc
tag:b my imp

--gets your backup copies of your documents based on their name

tag:a canc .li

--gets all your tagged archive copies of your livecode stack called Cancer
Cure

My wife makes the common mistake of thinking she needs to type out the
entire name and or search criteria; that's the beauty of Spotlight, with
the application of a little logic it can save a whole heap of typing and
mousing about and point directly to the file you need with less chance of
mistakenly opening the wrong one. People who code are definitely logically
inclined so they can easily figure out how to set Tags up and what it is
about a file/folder that makes it unique so they can type the least into
Spotlight

tag:o date:yesterday   or quicker to type
tag:o date:1/11/16

--gets all your original documents created, opened or modified yesterday or
on a specific date

BUT

tag:o

Should find all originals and list them by date last modified/opened. So in
all likelihood, if the last stack you worked on on Friday is going to be
the first stack you work on Monday, tag:o will be all you need to type into
Spotlight because the Top Hit will be the last original file you worked on,
so hit the Return key to have it Open for you. Once you start really using
Spotlight, and you start getting a better sense of how Spotlight thinks,
you adapt to make better use of it, ie you don't have Tags like Project 1,
Project 2, Project 3.

and yes, these are valid inputs as well

date:tomorrow
date:next month

--gets any calendar or reminder items due in the future - although Jacque,
if you write a Spotlight plugin for your Back to the Future stack we'll all
be able to do a Spotlight search for the Stacks we are going to create
'next week'. :-)
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting Finder results into LiveCode

2016-01-11 Thread Kay C Lan
On Mon, Jan 11, 2016 at 7:51 PM, Francis Nugent Dixon 
wrote:

>
> I use “cmd F” to find documents on my computer
> (never got round to using Spotlight).
>

Absolutely love Spotlight, use it hundreds of time a day and it saves me an
incalculable amount of time and effort. Have successfully weened my wife
onto it. Once you've learned to cmd + spacebar + type a few letters of the
App/Folder/File/Contact/Preference/email content then hit Return when
the one you are looking for is hilited, you'll never go back to mousing
around the Finder. Spotlight is to Finder like LiveCode is to C

Is there a way to get the results of such a “Find”
> inside a Rev stack ? Anybody done this ???
>

You can 'do  as AppleScript' but it's long and convoluted and
AppleScript is so ugly once you've worked with LC. ;-)


> I am a buggar for backups, and for one original, I
> have copies on several of my external disks.
> I want to update all the copies of a file that I just
> modified, and by hand, it’s a pain !
>
> Sounds like you simply need a good piece of back-up software. Love Carbon
Copy Cloner myself; have different types of backups (Archive, Clone, entire
disc, specific folders, different schedules...) all set up for different
and typically multiple discs and if any of them are missed because the
laptop either isn't connected to the network disks or physically connected
to the direct connect disks then as soon as they are connected the
backups/archive will run. Painless.

http://bombich.com/

But for this particular situation you could go with the less capable but
highly suited to your case and less expensive, SuperDuper

http://www.shirt-pocket.com/SuperDuper/SuperDuperDescription.html


> And just in case I haven’t got enough, is there a way
> to display in a liveCode stack the results of a “Get Info”
> from the finder ?
>

have a look at the 'files' entry in the Dictionary, particularly the
'detailed files' entry which gives you all you should need.

>
> I seem to spend half my life in "housekeeping"
>

But this all begs the question. Unless you are constantly moving your
Master file around surely you know where your Master file is and where the
back-ups are and so could easily hard code the file patht into LC and have
it check the 'detailed file' info and see if you need a fresh copy on your
back-up. It's then up to you, are you after an Archive or a straight back
up? Either way you will always use the rename (look it up in the
Dictionary) command to Rename the Old file to include a Date time stamp
before you do the copy. This ensures nothing is lost should the copy fail -
power failure half way thru. Once renamed you can then copy the file
across. From memory (and I'm probably wrong here) LC can't copy files from
one HD to another. I've used the shell command 'ditto' for file transfer
across HDs. Look up 'ditto' in your favourite Man Page viewer. To use shell
commands in LC look up 'shell' in the Dictionary. If you are after an
archive you are done, if you need a simple back-up then you'll need to
Trash the old time stamped file.

Hint: the easiest way to get a file or folder's full path name as required
by these LC commands is to:

type cmd + space bar   then   'ter'   Terminal should now be hilited in
Spotlight. Press Return and Terminal will start up. All you then have to do
is drag any file or folder into the Terminal window and it's full file path
is revealed.

WARNING: the Dictionary entry for revDeleteFolder says that on OS X it uses
AppleScript to place the folder into the Trash. This is incorrect, the
folder is nuked, gone, lost, never to return. This is a CONFIRMED bug #
15176. 'delete file' does the same, but thankfully the Dictionary warns you
it's permanent.

If you are paranoid, then instead of using revDeleteFolder or delete file,
use the rename command to move the file/folder to the Trash. That way it
can still be recovered until you manually empty the Trash

rename file "/Volumes/Backup Disk 7/MyLifesWork 2016112211.livecode" to
"/Volumes/Backup Disk 7/.Trash/MyLifesWork 2016112211.livecode"

Note the intentional period before Trash

You can do this for Files or Folders. I use to do this ages ago until I
eventually bought Carbon Copy Cloner, my files are too way precious it just
didn't make cents (yes with a c) to risk them with my own code ;-)

I'm sorry if this sounds like I'm telling you to suck eggs but I know there
are many lurkers on this List so I write for the lowest common denominator
who may be reading - which I appreciate isn't you.  :-)
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Getting Finder results into LiveCode

2016-01-11 Thread Richard Gaskin

Francis Nugent Dixon wrote:

I use “cmd F” to find documents on my computer
(never got round to using Spotlight).
Is there a way to get the results of such a “Find”
inside a Rev stack ? Anybody done this ???
I am a buggar for backups, and for one original, I
have copies on several of my external disks.
I want to update all the copies of a file that I just
modified, and by hand, it’s a pain !

And just in case I haven’t got enough, is there a way
to display in a liveCode stack the results of a “Get Info”
from the finder ?

I seem to spend half my life in "housekeeping"


If the larger goal here is to manage backups, I can describe what I do 
these days and although how people manage their backups is a very 
personal choice hopefully some of this will be useful:


With backups I have two goals:

- Redundancy, recognizing that drives fail
- Versioning, recognizing that the latest version may not always
  be the one I want

I use two mechanisms for versioning, and rsync for everything else.

I happen to use ownCloud for syncing not only my LC Plugins folder but 
also the folder containing my work files (and a few others).  Dropbox, 
Google Drive, and Time Machine also provide versioning, so which one is 
used is often less important than that at least one of them is used. 
ownCloud is more flexible than the others, so while it's more work to 
set up I need a server in the office for testing anyway, so it was 
convenient enough to add ownCloud to that.


So while ownCloud keeps my Ubuntu workstation, Ubuntu laptop, and OS X 
workstation in sync with a versioned repository through my local server, 
I also have Time Machine on my Mac to have a second copy versioned 
through different means.


With this, with the various synced machines I have two versioned 
archives and three current copies of all data.


But all of this is in my office, and I live in an earthquake-prone area. 
 Given that portable HDDs are available at about US$50/TB, I have four 
of them, and each night I sync my work folders and email to one of those 
drives, and take it home to bring the next one in the following day. 
Periodically I also save a complete archive of work files as a snapshot 
(space being cheaper than time).  So even if my office is destroyed and 
some of the offsite drives fail, the worst case leaves me with at least 
one complete copy of all current and archived files.


The key to being able to conveniently backup to a portable drive has 
been rsync.  It's a very smart algo that automatically does a lot of 
what I think I was reading in your post:


With a given source folder and a destination folder, it can recursively 
go through all folders and compare all files, skipping any where the mod 
date and file size are the same (there's also an option to force a 
checksum, but that's usually not needed since it's extremely rare that a 
file will change in a way that leaves the size and mod date the same).


This is quite efficient in itself, but it gets better:  once rsync finds 
a file that needs replacing, it compares segments of the file and only 
copies the segments that have changed.


All this comes together to make a solution that's about as efficient as 
it can be, and very easy to write into a text file on your drive that 
you can call whenever you need it, e.g.:


rsync -av /Users/username/WorkFolder/  /Volumes/backupdrive/WorkFolder/

rsync has many options (it's a deeply flexible tool), but the ones shown 
here are:


 a: archive mode, preserves time stamps, user and group ownership,
and other file attributes useful to make a true mirror of the
source.

 v: verbose mode, displays each action in Terminal as it's running;
most of the time I don't care, but it's interesting to watch.

If backing up over a network it can be useful to add a z option there, 
which uses gzip compression for each packet copied to reduce 
transmission time.


The end result is half a dozen drives with complete copies of the entire 
directory structure of all useful files, with time stamps preserved to 
make a truly complete and multiply redundant collection of backups.


rsync is preinstalled on OS X and Linux, and can be used on Windows when 
the free Cygwin package is installed.


There are many tutorials on using rsync on OS X for backups - here's 
just one:



--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Getting Finder results into LiveCode

2016-01-11 Thread Martin Koob
Any time I see "can you get this info on a Mac" I head for the shell.

I found the following for a terminal command to get file info.

http://apple.stackexchange.com/questions/165095/is-there-a-similar-functionality-of-get-info-cmdi-from-the-mac-os-x-termina

So it says use the mdls command

So then I put it in a shell function in a LiveCode Script.

http://apple.stackexchange.com/questions/165095/is-there-a-similar-functionality-of-get-info-cmdi-from-the-mac-os-x-termina

on mouseUp
   answer File "Select file to get info on..."
   put it into tFilePath
   put shell( "mdls" && tFilepath) into tFileInfo
   put tFileInfo into field 1
end mouseUp

Then you get the following data in tFileInfo that you would then parse for
the data you want.

---
kMDItemAlternateNames  = (
"MyFile.rtf"
)
kMDItemContentCreationDate = 2016-01-11 15:04:45 +
kMDItemContentModificationDate = 2016-01-11 15:04:45 +
kMDItemContentType = "public.rtf"
kMDItemContentTypeTree = (
"public.rtf",
"public.text",
"public.data",
"public.item",
"public.content"
)
kMDItemDateAdded   = 2016-01-11 15:04:45 +
kMDItemDisplayName = "MyFile"
kMDItemFSContentChangeDate = 2016-01-11 15:04:45 +
kMDItemFSCreationDate  = 2016-01-11 15:04:45 +
kMDItemFSCreatorCode   = ""
kMDItemFSFinderFlags   = 16
kMDItemFSHasCustomIcon = (null)
kMDItemFSInvisible = 0
kMDItemFSIsExtensionHidden = 1
kMDItemFSIsStationery  = (null)
kMDItemFSLabel = 0
kMDItemFSName  = "MyFile.rtf"
kMDItemFSNodeCount = (null)
kMDItemFSOwnerGroupID  = 20
kMDItemFSOwnerUserID   = 501
kMDItemFSSize  = 332
kMDItemFSTypeCode  = ""
kMDItemKind= "Rich Text Document"
kMDItemLastUsedDate= 2016-01-11 15:04:45 +
kMDItemLogicalSize = 332
kMDItemPhysicalSize= 4096
kMDItemUseCount= 1
kMDItemUsedDates   = (
"2016-01-11 05:00:00 +"
)
-


Martin



--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Getting-Finder-results-into-LiveCode-tp4700069p4700072.html
Sent from the Revolution - User mailing list archive at Nabble.com.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting Finder results into LiveCode

2016-01-11 Thread Klaus major-k
Hi Francis,

> Am 11.01.2016 um 12:51 schrieb Francis Nugent Dixon :
> 
> Hi from Beautiful (but wet) Brittany,
> 
> A tiny problem.
> 
> I use “cmd F” to find documents on my computer
> (never got round to using Spotlight).
> Is there a way to get the results of such a “Find”
> inside a Rev stack ? Anybody done this ???
> I am a buggar for backups, and for one original, I
> have copies on several of my external disks.
> I want to update all the copies of a file that I just
> modified, and by hand, it’s a pain !
> 
> And just in case I haven’t got enough, is there a way
> to display in a liveCode stack the results of a “Get Info”
> from the finder ?
> 
> I seem to spend half my life in „housekeeping"

you could use SHELL with „mdfind“ like this:
…
put "your searchterm“ into tSearchTerm
put shell("mdfind“ && q(tSearchTerm)) into fld "found files“
…

function q tString
  return QUOTE & tString & QUOTE
end q

SHELL is blocking, but works really fine ;-)

Check the MAN pages for mdfind in the terminal.

> -Francis
> 
> “Nothing should ever be done for the first time !”

Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting Finder results into LiveCode

2016-01-11 Thread J. Landman Gay
I'd use Spotlight more too if it would show the file path to each of duplicate 
copies of a file. Cmd-F does that if you have the path info at the bottom of 
the window turned on in Finder. I often have a master copy and a duplicate in a 
shared dropbox folder, as well as multiple historical copies in labelled 
folders, and I need to know which copy I'm about to open. 

Cmd-F in Finder gives you a list of all copies with all the usual details 
(size,  date, etc.) so I use that more often. It sounds like that's what 
Francis needs too. 

BTW, a quick way to copy (most of) the file path to the clipboard is to Get 
Info on it and copy the path from the there. You do need to add the short name 
at the end so it isn't perfect. I've installed a contextual menu addition that 
copies the path. 

None of this actually answers the question though. I don't think there's a way 
to get a found file list in LC without the help of an Applescript or by doing a 
complete directory walk. 

On January 11, 2016 8:11:43 AM CST, Kay C Lan  wrote:
>On Mon, Jan 11, 2016 at 7:51 PM, Francis Nugent Dixon
>
>wrote:
>
>>
>> I use “cmd F” to find documents on my computer
>> (never got round to using Spotlight).
>>
>
>Absolutely love Spotlight, use it hundreds of time a day and it saves
>me an
>incalculable amount of time and effort. 
-- 
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode