the text of the image of the window info of a file

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

the text of the image of the window info of a file

Post by jmburnod » Mon Jan 17, 2011 9:59 pm

Hi All,

Is there a way to get the text of the picture of the window infos of a file ?

Best

Jean-Marc
https://alternatic.ch

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4003
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: the text of the image of the window info of a file

Post by bn » Mon Jan 17, 2011 10:07 pm

Hi Jean-Marc,

I don't understand, what exactly are you looking for. Could you give an example?

What kind of info do you want. Do you want the picture?, the size, the dimension?

Kind regards

Bernd

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: the text of the image of the window info of a file

Post by mwieder » Mon Jan 17, 2011 11:12 pm

...the thumbnail? ...the icon?

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: the text of the image of the window info of a file

Post by jmburnod » Tue Jan 18, 2011 10:09 am

Hi,
Thank for your reply
I want the horse picture
It is the thumbnail or an icon?

Jean-Marc
Attachments
infosAbout.jpg
infosAbout.jpg (15.96 KiB) Viewed 6029 times
https://alternatic.ch

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4003
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: the text of the image of the window info of a file

Post by bn » Tue Jan 18, 2011 12:06 pm

Hi Jean-Marc,

one way is to open infos, click at the icon (there will be a blue rectangle around it) and copy. In Livecode you can paste this.

If you want it by script this is a bit trickier. I would have to look into that. I dont know if one could get at it with applescript.

Kind regards

Bernd

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: the text of the image of the window info of a file

Post by jmburnod » Tue Jan 18, 2011 6:54 pm

Hi Bernd,
If you want it by script this is a bit trickier
Yes i want it by script in OSX, windows and if you give me the moon also that is perfect :wink:

Jean-Marc
https://alternatic.ch

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4003
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: the text of the image of the window info of a file

Post by bn » Tue Jan 18, 2011 9:39 pm

Hi Jean-Marc,

I found this on the use-List from Terry Judd

http://www.mail-archive.com/use-revolut ... 17196.html
Type...

go url "http://deblah.com/rev/MacIconToFile_demo.rev"

...into the message box to download it.

Terry...
I just tested the link and it still works. Is a very nice stack you just drop a file on to get the icon.

For Windows I dont know, there is a stack on revOnline Icon Loader. I don't know what it does, since it is for Windows icons.


I append a simple stack that gets via a shell command all the icns it can find.

use this applescript to open an icon in Preview

Code: Select all

set theFile to "/Applications/Script Debugger 4.5.app/Contents/Resources/AppleEventLog.icns"
tell application "Preview"
	open theFile
        activate
end tell
Where theFile is one line of the result of the getShellIcns


Regarding the moon i have one more question:

do you want the full moon or would a half/quarter moon be enough :)

Kind regards

Bernd

Edit 1, corrected first Name from Mark to Jean-Marc.
Attachments
getShellIcns.rev.zip
(1.14 KiB) Downloaded 214 times

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4003
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: the text of the image of the window info of a file

Post by bn » Wed Jan 19, 2011 1:39 pm

The following was erroneously posted in another thread:

http://forums.runrev.com/phpBB2/viewtop ... 230#p30230

I try to move it here.

Jean-Marc wrote:
Hi Bernd,

Yes. The link work, getIconToFile work and getShellIcns work also.

I tried this

CODE: SELECT ALL
on ShInPrev
put fld "fmyAS" into appleScriptInit
do appleScriptInit as "applescript"
end ShInPrev


with this content in fld "fmyAS"

set theFile to "/Applications/ Jeux/Chess.app/Contents/Resources/chess.icns"
tell application "Preview"
open theFile
activate
end tell


The script open "Aperçu" but no image come

All the best

Jean-Marc
P.S. I need times to think about the moon
to which Bernd replied
Hi Jean-Marc,
set theFile to "/Applications/ Jeux/Chess.app/Contents/Resources/chess.icns"

there is a space before Jeux which probably does not belong there. Try this without the space.

I tried again with the script and a valid path and it works

by the way, we started this conversation here
viewtopic.php?t=6523&p=30177#p30177

Kind regards
Bernd
Last edited by bn on Wed Jan 19, 2011 2:26 pm, edited 1 time in total.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4003
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: the text of the image of the window info of a file

Post by bn » Wed Jan 19, 2011 2:25 pm

Hi Jean-Marc,

try to put this into the script field
set theFile to "/Applications/FileMaker Pro 8/ FileMaker Pro.app/Contents/Resources/FMApp.icns"
try
set theFile to POSIX file theFile as alias
on error
return "file not found"
end try
tell application "Preview"
open theFile
activate
end tell
and this into a button

Code: Select all

on mouseUp
   do field 1 as applescript
   put the result into field 2
end mouseUp
you would have to make a field 2 for the error message

Now if the file is not found applescript returns an error message.

Kind regards
Bernd

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4003
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: the text of the image of the window info of a file

Post by bn » Wed Jan 19, 2011 3:44 pm

Hi Jean-Marc

Jean-Marc wrote
Hi Bernd,

I tested with my Imac intel duo Core and it work fine

It is different on my Powerbook G4 10.4.2 (first tested)

Curiously, the getIconPaths via Shell return a space before "jeux".
I looked at the name of the folder and it have effectly a space.
I deleted it but no change
I restart the computer, the getIconPaths via Shell return always a space before "Jeux" (the name of the folder is "Jeux")

With others folder like adressbook, no space before but no image come

Best

Jean-Marc
No need to rename the apps. It should work without.

Please try this script in the field for applescript. Add a second field for the error message
set theFile to "/Applications/FileMaker Pro 8/ FileMaker Pro.app/Contents/Resources/FMApp.icns"
try
set theFile to POSIX file theFile as alias
on error
return "file not found"
end try
tell application "Preview"
open theFile
activate
end tell
This script converts the "/" style of path to the more common ":" of the Mac. And it returns an error if the file is not found.

Applescript as of version MacOSX 10.4.x can not use the "/" style of a path directly. That is the reson why it did not work. The above script works with MacOSX 10.4.x

Jean-Marc est-ce que tu es dans la lune? :) réponds ici, s'il te plaît.

Kind regards

Bernd

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: the text of the image of the window info of a file

Post by jmburnod » Wed Jan 19, 2011 7:52 pm

Hi Bernd,
est-ce que tu es dans la lune?
:oops: It is possible.In fact i didn't understand our last exchanges

Now, the last script work on my powerbook.

Best

Jean-Marc
https://alternatic.ch

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”