How do I save a chart as a jpeg?
How do I save a chart as a jpeg. In excel I right click, "save as picture." Not seeing anything like that in Numbers.
Mac, Mac OS X (10.6.4)
How do I save a chart as a jpeg. In excel I right click, "save as picture." Not seeing anything like that in Numbers.
Mac, Mac OS X (10.6.4)
If you wan't an app behaving like Excel, use Excel !
Your question was asked and answered several times.
cmd + P to open the Print dialog
local menu PDF > Show in Preview.
You will get something like that :
Here you see that I selected a subset of the PDF with the Selection Tool
cmd + c to copy the selection to the clipboard
cmd + n to create a new document from the clipboard
you will get something like that :
cmd + s to save the document setting the format which you want :
As the source was a PDF, the app defaults to PDF (which is checked) but we may select one of the five other formats.
Under 10.6.x you may apply a shorter scheme :
When the doc is displayed in Preview, use the Selection tool to define the area to keep
cmd + k to crop to the selection
cmd + shift + s and define the format which you want.
This process loose interest under Lion because when we crop, the system issue a dialog claiming that we aren't allowed to edit the PDF which was never saved. If we answer that we really want to do that, it duplicate the doc and crop the duplicate. All in all, it requires more time tha what I described at first.
PS: if your system is really 10.6.4, it would be a good idea to update to 10.6.8 which brought some security enhancements.
Yvan KOENIG (VALLAURIS, France) samedi 12 janvier 2011 16:15:50
iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
My iDisk is : <http://public.me.com/koenigyvan>
Please :
Search for questions similar to your own
before submitting them to the community
Hello Wayne
With your scheme you would get only :
With mine I get :
Given that, it's matter of needs.
I'm just accustomed to questions like : how may we get the charts with their text components ?
Yvan KOENIG (VALLAURIS, France) samedi 12 janvier 2011 19:00:26
iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
My iDisk is : <http://public.me.com/koenigyvan>
Please : Search for questions similar to your own before submitting them to the community
I did search for the answer first dude. I certainly don't want to read an obnoxious response like yours if I can avoid it, nor do I want (not wan't as you wrote) a 12 step process to copy and paste a picture.
Wayne, That works great. Not as simple as I'd like, but simple enough. Much appreciated.
I assumed that you wanted to save as JPEG the complete chart with its text components.
If you want to save only the graphic components,
Here is a script which requires only to type a shortcut if you use FastScripts (I use it with cmd + option + ctrl + j).
--{code}
--[SCRIPT chart_or_logo_to_JPEG.scpt]
(*
Enregistrer le script en tant que Script : chart_or_logo_to_JPEG.scpt
déplacer le nouveau fichier script dans le dossier :
<VolumeDeDémarrage>:Utilisateurs:<votreCompte>:Library:Scripts:
Sélectionner un graphique ou un logo.
Aller au menu Scripts, puis choisir chart_or_logo_to_JPEG
Le script copie la sélection puis demande à Aperçu de créer un nouveau document depuis le Presse papiers.
Il ouvre le dialogue Enregistrer (Enregistrer… sous Lion) puis fixe le format à JPEG.
Il vous reste à définir le nom et la destination du fichier.
--=====
L'aide du Finder explique:
L'Utilitaire AppleScript permet d'activer le Menu des scripts :
Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
Cochez la case "Afficher le menu des scripts dans la barre de menus".
Sous 10.6.x,
aller dans le panneau "Général" du dialogue Préférences de l'Éditeur Applescript
puis cocher la case "Afficher le menu des scripts dans la barre des menus".
--=====
Save the script as a Script : chart_or_logo_to_JPEG.scpt
Move the newly created script file into the folder :
<startup Volume>:Users:<yourAccount>:Library:Scripts:
Select a chart or a logo.
Go to the Scripts Menu, then choose chart_or_logo_to_JPEG
The script copy the selection then ask Preview to create a new document from the clipboard.
It opens the Save (Save… under Lion) dialog then set the file format to JPEG.
You will define the name and the location of the file.
--=====
The Finder's Help explains:
To make the Script menu appear:
Open the AppleScript utility located in Applications/AppleScript.
Select the "Show Script Menu in menu bar" checkbox.
Under 10.6.x,
go to the General panel of AppleScript Editor’s Preferences dialog box
and check the “Show Script menu in menu bar” option.
--=====
Yvan KOENIG (VALLAURIS, France)
2011/11/14
*)
--=====
property pour_tests : false
(*
Must be true when we run the script from the AppleScript Editor.
May be false when the script is OK.
With the setting false, it will identify the running application by itself *)
--=====
on run
local nbw, nomFenetre
if pour_tests then
set theApp to "Numbers"
else
tell application "System Events" to set theApp to name of first application process whose frontmost is true
end if
set the clipboard to ""
(*
Copy the selection from the frontmost application *)
tell applicationtheApp to activate
delay 0.1
tell application "System Events" to tell application process theApp to keystroke "c" using {command down}
(*
Wait for achievement of the copy task *)
repeat
try
delay 0.2
the clipboardas «class PDF »
exit repeat
end try
end repeat
tell application "Preview" to activate
tell application "System Events" to tell application process "Preview"
set nbw to countwindows
(*
Trigger the menu item "File > New from Clipboard" *)
keystroke "n" using {command down}
(*
Wait the availability of the new PDF window *)
repeat while nbw = (count windows)
delay 0.2
end repeat
(*
Get the name of the new window *)
set nomFenetre to name of window 1 --(first window whose subrole is "AXStandardWindow")
keystroke "s" using {command down}
(*
Wait the availability of the Save sheet *)
repeat until exists sheet 1 of window nomFenetre
delay 0.2
end repeat
tell sheet 1 of window nomFenetre
-- properties of every UI elements
tell group 1
click first pop up button
delay 0.2
-- properties of every menu item of menu 1 of first pop up button
clickmenu item "JPEG" of menu 1 of first pop up button
delay 0.2
end tell -- group
-- click button 1 (* Click in the Save button *)
end tell -- sheet
end tell -- System Events
end run
--=====
--[/SCRIPT]
--{code}
Yvan KOENIG (VALLAURIS, France) lundi 14 janvier 2011 18:42:37
iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
My iDisk is : <http://public.me.com/koenigyvan>
Please : Search for questions similar to your own before submitting them to the community
I love it. That was the perfect response to me.
The script works for almost whatever you have selected: chart, table, shape, or multiple selected items. Doesn't work so well if you select an entire sheet in the sidebar, though. And it does not get table names or chart elements (name, legend) but we already knew that.
Hello Badunit
(1) I know that and it's why my first answer describe the way to build a jpeg using the
Print > PDF > Show in Preview scheme which is the only one allowing us to pass the name and the legend.
I posted the script only because the OP wrote :
Wayne, That works great. Not as simple as I'd like, but simple enough. Much appreciated.
about the answer grabbing only the graphic component of the chart.
(2) about the fact that it doesn't apply if we select a sheet in the sidebar, it's a feature which surprised me too.
If we select such an object, the script doesn't appear in the Script menu so it's not that it doesn't work, it's that it's not triggered.
If you want to grab the entire sheet you must apply the Print > PDF > Show in Preview scheme.
(3) The posted script is not dedicated to Numbers.
I will try to build an alternate one, dedicated to Numbers and this time, I hope that I will be able to use it for every cases.
If the selection is a subset of a sheet, it would use the existing code but if the selection is a sheet, it would use a code dedicated to the Print > PDF > Show in Preview scheme.
Yvan KOENIG (VALLAURIS, France) mardi 15 janvier 2011 09:45:05
iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
My iDisk is : <http://public.me.com/koenigyvan>
Please : Search for questions similar to your own before submitting them to the community
Oops
When the script wasn't appearing in the Scripts menu, it was not because a sheet was selected but because some tests upon a draft script pushed my system in a wrong state.
After rebooting, the script appears.
The result is a bit surprising.
Only the tables are displayed correctly.
If I select every objects, the script build :
Which is better but charts title/legend are missing.
I forgot the fact that there is no clean way to identify the kind of selected object in Numbers.
So, at this time, I'm unable to build a script self identifying the selection but I'm pig headed so I continue the search.
Yvan KOENIG (VALLAURIS, France) mardi 15 janvier 2011 11:22:35
iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
My iDisk is : <http://public.me.com/koenigyvan>
Please : Search for questions similar to your own before submitting them to the community
Here is a script dedicated to Numbers.
You will find explanations in French and English at the beginning.
CAUTION :
it requires the installation of a Unix command file which gives us the ability to check if a modifier key is depressed.
During my tests, only shift or fn keys were correctly detected.
Maybe it was because I did my tests in the AppleScript Editor.
I choose the fn key which, as far as I know, is not used to define the area to save.
--{code}
--[SCRIPT subset_of_numbers_doc_to_jpeg]
(*
Télécharger getModKey.zip depuis
http://allancraig.net/index.php?option=com_docman&Itemid=100
Décompacter puis déplacer le fichier getModKey dans le dossier
<VolumeDeDémarrage>:Users:<votreCompte>:UnixBins:
Il vous faudra peut-être créer le dossier UnixBins.
Détails complémentaires dans :
http://macscripter.net/viewtopic.php?id=33652
Enregistrer le script en tant que Script : subset_of_numbers_doc_to_jpeg.scpt
déplacer le fichier ainsi créé dans le dossier
<VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
Ouvrir un document Numbers et afficher la feuille dont une portion doit être enregistrée dans un fichier jpeg.
Aller au menu Scripts , choisir Numbers puis choisir “subset_of_numbers_doc_to_jpeg”
Le script affiche la feuille au format PDF dans Aperçu.
Sélectionnez la zone à enregistrer puis pressez la touche fn.
Le script copie la sélection dans le Presse-papiers, ferme le PDF complet,
crée un nouveau PDF à partir du Presse-papiers
puis ouvre le dialogue Enregistrer au format jpeg.
Il restera à définir le nom et la destination du fichier.
--=====
L’aide du Finder explique:
L’Utilitaire AppleScript permet d’activer le Menu des scripts :
Ouvrez l’Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
Cochez la case “Afficher le menu des scripts dans la barre de menus”.
Sous 10.6.x,
aller dans le panneau “Général” du dialogue Préférences de l’Éditeur Applescript
puis cocher la case “Afficher le menu des scripts dans la barre des menus”.
--=====
Download getModKey.zip from
http://allancraig.net/index.php?option=com_docman&Itemid=100
Expand it then move the getModKey file into the folder
<startupVolume>:Users:<yourAccount>:UnixBins:
Maybe you would have to create the folder UnixBins.
Details available in :
http://macscripter.net/viewtopic.php?id=33652
Save the script as a Script: subset_of_numbers_doc_to_jpeg.scpt
Move the newly created file into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
Open a Numbers document and display the sheet whose a subset must be saved in a jpeg file.
Go to the Scripts Menu, choose Numbers, then choose “subset_of_numbers_doc_to_jpeg”
The script display the sheet in a Preview's PDF window.
Select the area to save then press the fn key.
The script copy the selected area in the clipboard, close the full PDF,
create a new PDF from the clipboard's contents
then open a dialog to Save as jpeg.
Define the name and the storage location.
--=====
The Finder’s Help explains:
To make the Script menu appear:
Open the AppleScript utility located in Applications/AppleScript.
Select the “Show Script Menu in menu bar” checkbox.
Under 10.6.x,
go to the General panel of AppleScript Editor’s Preferences dialog box
and check the “Show Script menu in menu bar” option.
--=====
Yvan KOENIG (VALLAURIS, France)
2011/11/15
*)
--=====
on run
local nomFenetre, nbw
(*
Check that the Unix command file getModKey is available in the folder <startupVolume>:Users:<yourAccount>:UnixBins: *)
set flPth to ("" & (path to home folder) & "UnixBins:")
tell application "System Events" to set maybe to exists disk item (flPth & "getModKey")
if not maybe then
if not my parleAnglais() then
error "Please, install “getModKey” in the folder" & return & "“" & flPth & "” !"
else
error "Veuillez installer « getModKey » dans le dossier « " & flPth & " » !"
end if
end if
set flPth to quoted form of POSIX path of (flPth & "getModKey")
tell application "Numbers" to activate
tell application "System Events" to tell application process "Numbers"
(*
Get the name of the frontmost standard window
so that we will not 'speak' to an inspector or to the Find dialog *)
set nomFenetre to name of first window whose subrole is "AXStandardWindow"
keystroke "p" using {command down}
(*
Wait the availability of the Print sheet *)
tell windownomFenetre
repeat until exists sheet 1
delay 0.2
end repeat
tell sheet 1
click first menu button
click first menu item of menu 1 of first menu button
end tell -- sheet
end tell -- window
end tell -- System Events
tell application "Preview" to activate
tell application "System Events" to tell application process "Preview"
set nbw to count of every window
repeat while nbw = (count windows)
delay 0.2
end repeat
(*
Trigger the menu item Tools > Selection Tool *)
keystroke "3" using {command down}
end tell -- System Events
(*
Now, select the area which must be saved in a jpeg file *)
(*
Thanks to the command getModKey, loop until the fn key is depressed *)
repeat
delay 0.2
if (do shell script flPth) = "131072" then exit repeat
end repeat
(*
The fn key was depressed so we may copy the defined area to the clipboard *)
tell application "Preview" to activate
tell application "System Events" to tell application process "Preview"
(*
Empty the clipboard. So we will be able to check that the copy task is achieved *)
set the clipboard to ""
(*
Copy to clipboard *)
keystroke "c" using {command down}
(*
Loop waiting for the achievement of the Copy task *)
repeat
delay 0.2
try
the clipboardas «class PDF »
exit repeat (* Exit when the task is achieved *)
end try
end repeat
set nbw to countwindows
(*
Close the PDF window *)
keystroke "w" using {command down}
(*
Wait the achievement of the Close task *)
repeat while nbw = (count windows)
delay 0.2
end repeat
set nbw to countwindows
(*
Create New PDF from the clipboard *)
keystroke "n" using {command down}
(*
Wait the availability of the new PDF window *)
repeat while nbw = (count windows)
delay 0.2
end repeat
(*
Get the name of the new window *)
set nomFenetre to name of window 1 --(first window whose subrole is "AXStandardWindow")
keystroke "s" using {command down}
(*
Wait the availability of the Save sheet *)
repeat until exists sheet 1 of window nomFenetre
delay 0.2
end repeat
tell sheet 1 of window nomFenetre
-- properties of every UI elements
tell group 1
click first pop up button
delay 0.2
-- properties of every menu item of menu 1 of first pop up button
clickmenu item "JPEG" of menu 1 of first pop up button
delay 0.2
end tell -- group
-- click button 1 (* Click in the Save button *)
end tell -- sheet
end tell -- System Events
end run
--=====
on parleAnglais()
local z
try
tell application "Numbers" to set z to localized string "Cancel"
on error
set z to "Cancel"
end try
return (z is not "Annuler")
end parleAnglais
--=====
--[/SCRIPT]
--{code}
Of course, thanks to FastScripts, we may link a shortcut to the script.
Yvan KOENIG (VALLAURIS, France) mardi 15 janvier 2011 19:04:38
iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
My iDisk is : <http://public.me.com/koenigyvan>
Please : Search for questions similar to your own before submitting them to the community
How do I save a chart as a jpeg?