Toggle Finder sort order with AppleScript under Lion 10.7?
For years I've been using this AppleScript to toggle the sort order of a Finder window:
if sort direction of column id size column of list view options of window 1 is normal then
set sort direction of column id size column of list view options of window 1 to reversed
else
set sort direction of column id size column of list view options of window 1 to normal
end if
(You can replace size with kind, name, modification date, etc.)
But ever since Lion, this no longer works!
The little arrow in the column header DOES change, but the items do not re-sort.
Any way to get this working?
Why not just click on the columns?
Similar Messages
-
"Safari can't find the server" - connection issues under Lion
Hi there,
Since upgrading to Lion, Safari has been displaying this odd and annoying behaviour, where, for some links to some web resources (like maybe 2 clicked links out of 10), it throws up a grey error page telling me it can't find the server (screenshot below):
Normally, this error would be evidience of an intenet connection issue (but it isn't). If I immediately try to find the same resource via another browser (Firefox or Chrome), those other browsers navigate to the site absolutely fine. Although, occasionally (though with less frequency) I'm also getting a similar "Can't find stuff" error with Chrome too.
In the Safari address bar (is this significant?) there isn't even a URL, but a file path to file:///Applications/Safari.app/Contents/Resources... what does that mean?
Hints from other threads would indicate that this is a Firewall issue, or maybe there's another third-party app causing problem, rather than a problem with Safari under Lion specifically.
But I'm really bugged and irrittate by this. Anyone had a similar experience? Anyone with any ideas? How might I go about finding out what's causing this and fixing it?
Best wishes,It's most likely a problem with corrupted files in the Safari Cache or corrupted cookies.
Go to Safari menu bar
Click on Safari
Click "Empty Cache"
Restart Safari
If the problem persists...
Go to Safari -> Preferences
Go to privacy
Click "Remove All Website Data"
Restart Safari
Cheers - Lupunus -
Setting "Date Received" sort order via Applescript?
For my 86-year-old Mom, I want to create an applescript that will always ensure upon launch that her Apple Mail's inbox is always the selected mailbox, and that the sort order is set to Date Received with the newest email at the top. (I'm assuming that would be Descending?) She keeps clicking on the column heads by accident which messes up the inbox's sort order -- and then she doesn't know what to do to correct it. (Well, I've shown her, but her memory isn't such that she can remember it tomorrow after drilling her on it today.)
I found a way to make sure the sort order is by "Date Received" but I haven't been able to determine if I can ensure the sort order or not.
Any help would be greatly appreciated!
Message was edited by: BrianJohnsDimaxum,
Thanks for your thoughts and the link. I've been there and boy, if there's a solution in there I haven't found it yet! Lots to look at.
I would love to be able to freeze the UI settings in Mail and prevent Mom from messing up the sort order. Haven't figured out how to do that or even if it's possible. Short of that I'm thinking that running an Applescript to correct anything that might have been changed last time she was in the Mail application is the best I can do. I have the Applescript set to run at login, and it takes care of launching Mail when she boots up her computer. I also need to reset the position of the mail window on her screen and the size of the window and whether or not the preview pane is showing. If she accidentally resizes her window, or gets it off the screen, or loses the preview pane -- she's totally lost.
I've found Applescript examples that let me perform a menu action, but there's nothing to check the state of "toggle" items -- for example, command-1 both closes and opens the Activity window. I'd like for it to only make sure that Activity window is open. Mom keeps closing it and then she wonders where it went.
I could do all this stuff "back in the day" with QuicKeys. I'm thinking I should be able to do it with Applescript -- but I've never found Applescript (or automator) to be as understandable and usable as the old QuicKeys was. I do OK with Applescript as long as I can find an example -- but coming up with syntax and stuff like that out of the blue requires more experience with it than I'll ever have.
I just looked up the price for QuicKeys. $60 -- wow, I'd love to have it again but that's just too pricey for this single application.
Any more ideas or pointers, anyone??
Message was edited by: BrianJohns -
How to find open orders with amount and open deliveries?
Hi All,
I want to find out the open orders with open amount and open deliveries for a particular customer.
We need this for credit check purpose.
Kindly guide us for this.
Regards,
Satish.Hi,
To find out open order:
data: c_bef_pgi(1) TYPE c VALUE 'A',
RANGES: rg_wbstk FOR vbuk-wbstk."range for wbstk
rg_wbstk-sign = 'I'.
rg_wbstk-option = 'EQ'.
rg_wbstk-low = 'C'.
APPEND rg_wbstk.
rg_wbstk-low = 'A'.
APPEND rg_wbstk.
1.first put query on vbak table
2.Put query on vbuk table as
SELECT vbeln bestk lfstk gbstk FROM vbuk
INTO TABLE it_vbuk_open
FOR ALL ENTRIES IN it_vbak
WHERE vbeln = it_vbak-vbeln AND
bestk IN rg_wbstk AND
lfstk = c_bef_pgi.
so this wil give u open orders.
3. Then according to vbuk, get the details from vbap.
To find open delivery
1. First put query on vbak table
2. Put query on vbfa as
SELECT vbelv posnv vbeln posnn vbtyp_n vbtyp_v FROM vbfa
INTO TABLE it_vbfa
FOR ALL ENTRIES IN it_vbak
WHERE vbelv = it_vbak-vbeln AND
vbtyp_n = 'J' AND
vbtyp_v = 'C'.
3.Then from VBfa,get the details from LIkp
4.Then put entry on vbuk as
*entries from vbuk
SELECT vbeln wbstk fkstk gbstk FROM vbuk
INTO TABLE it_vbuk_del
FOR ALL ENTRIES IN it_likp
WHERE vbeln = it_likp-vbeln AND
wbstk IN rg_wbstk AND
fkstk = c_bef_pgi.
Thanks & Regards,
Anagha Deshmukh -
Index sort order with underscore (_)
Hi.
According to the documentation, the default sort order for indexes is <$symbols><$numbers><$alphabetics> with hyphens, nonbreaking hyphens, en dashes, and em dashes ignored by default. Nothing about underscores, so they should be sorted on first, right? But they are not in my document. Example:
PaymentModule_Order_Head
PaymentModule_OrderPayment_Capture
PaymentModule_Order_Tabs
What I want to see is:
PaymentModule_Order_Head
PaymentModule_Order_Tabs
PaymentModule_OrderPayment_Capture
Is there an easy way to fix this so underscores have precedence over alphabetics? I've tried rearranging the building blocks every which way but nothing seems to work.> ... going through thousands of index entries and adding the sort order text.
That could be scripted, using dedicated Frame scripting tools, or, with MIF, ordinary text processing tools. Someone may even have done it already.
In MIF, it would "merely" be a matter of first batch converting all:
<MTypeName `Index'>
<MText `what appears in Index'>
pairs to:
<MTypeName `Index'>
<MText `what appears in Index[M00what appears in Index]'>
then hand edit only the Markers of the outliers to change the arbitrary "M00" prefix to whatever is needed to optimize the sort rank.
> FrameMaker is not behaving has doc'd here.
You have documentation for FrameMaker?
Why wasn't I told about this? -
Different sort order with line chart and stacked column chart
Hi,
I have a problem with sorting within flash charts.
The chart should be ordered by a date column.
If I'm using a line chart everything is fine. The columns in the chart are in the same order as returned by the query.
If I change the chart type to stacked column chart, I get a wrong order.
It is orderd like 5, 6, 7, 8, 9, 10, 1, 2, 3, 4.
What's wrong?
Here the query i use:
SELECT NULL AS link,
TO_CHAR (zeitpunkt, 'dd.mm.yyyy'),
MAX (DECODE (db_sid, 'TI06E', VALUE, NULL)) OVER (PARTITION BY zeitpunkt) AS "TI06E",
MAX (DECODE (db_sid, 'TI06T', VALUE, NULL)) OVER (PARTITION BY zeitpunkt) AS "TI06T",
MAX (DECODE (db_sid, 'TI14S', VALUE, NULL)) OVER (PARTITION BY zeitpunkt) AS "TI14S",
MAX (DECODE (db_sid, 'TI14T', VALUE, NULL)) OVER (PARTITION BY zeitpunkt) AS "TI14T",
MAX (DECODE (db_sid, 'TI16T', VALUE, NULL)) OVER (PARTITION BY zeitpunkt) AS "TI16T",
MAX (DECODE (db_sid, 'TI24K', VALUE, NULL)) OVER (PARTITION BY zeitpunkt) AS "TI24K",
MAX (DECODE (db_sid, 'TI33T', VALUE, NULL)) OVER (PARTITION BY zeitpunkt) AS "TI33T",
MAX (DECODE (db_sid, 'WF03E', VALUE, NULL)) OVER (PARTITION BY zeitpunkt) AS "WF03E",
MAX (DECODE (db_sid, 'WF03K', VALUE, NULL)) OVER (PARTITION BY zeitpunkt) AS "WF03K",
MAX (DECODE (db_sid, 'WF03T', VALUE, NULL)) OVER (PARTITION BY zeitpunkt) AS "WF03T",
MAX (DECODE (db_sid, 'WF05K', VALUE, NULL)) OVER (PARTITION BY zeitpunkt) AS "WF05K",
MAX (DECODE (db_sid, 'WF05T', VALUE, NULL)) OVER (PARTITION BY zeitpunkt) AS "WF05T",
MAX (DECODE (db_sid, 'WF06T', VALUE, NULL)) OVER (PARTITION BY zeitpunkt) AS "WF06T",
MAX (DECODE (db_sid, 'WF07K', VALUE, NULL)) OVER (PARTITION BY zeitpunkt) AS "WF07K",
MAX (DECODE (db_sid, 'WF07T', VALUE, NULL)) OVER (PARTITION BY zeitpunkt) AS "WF07T",
MAX (DECODE (db_sid, 'WF08K', VALUE, NULL)) OVER (PARTITION BY zeitpunkt) AS "WF08K",
MAX (DECODE (db_sid, 'WF08T', VALUE, NULL)) OVER (PARTITION BY zeitpunkt) AS "WF08T",
MAX (DECODE (db_sid, 'WF09K', VALUE, NULL)) OVER (PARTITION BY zeitpunkt) AS "WF09K",
MAX (DECODE (db_sid, 'WF09T', VALUE, NULL)) OVER (PARTITION BY zeitpunkt) AS "WF09T",
MAX (DECODE (db_sid, 'WF10K', VALUE, NULL)) OVER (PARTITION BY zeitpunkt) AS "WF10K",
MAX (DECODE (db_sid, 'WF10T', VALUE, NULL)) OVER (PARTITION BY zeitpunkt) AS "WF10T",
MAX (DECODE (db_sid, 'WG04T', VALUE, NULL)) OVER (PARTITION BY zeitpunkt) AS "WG04T",
MAX (DECODE (db_sid, 'WT05T', VALUE, NULL)) OVER (PARTITION BY zeitpunkt) AS "WT05T"
FROM db_performance_temp
ORDER BY zeitpunkt ASC
SQL> desc db_performance_temp
Name Null? Typ
ZEITPUNKT DATE
DB_SID VARCHAR2(30)
VALUE NUMBERI found the solution.
Anychart seems to have a problem with null values!
The corrupted sorting only occured for a specific set of search criteria and a specific day. At this day some values have been null.
I added a "nvl( [...], 0) for every value.
No I get a correct sort order. -
How to find Sort order in material master UOM
Hi,
Can any one tell me how to find the sort order for unit of measurement for UOM in additional data tab in material master.
If you see the db table, its stored in another order other than how its displayed on the screen.
Thanks,
Sujith.It appears that it is sorting on the MSEHI in the t006a. This is the internal representation of the UOM. It is doing the same in the material master, you just can't see the internal field there. In my system here is how it is sorting. The commerical is what you see in the material master, the internal is what it is sorted by.
Internal Commerical Description
A A A
B45 QML kmol
BAR BAR bar
HN /C Hundred
PC PC Piece
TH /M Thousand
Regards,
Rich Heilman -
Hi everyone !
Is there a way to find a file using AppleScript ?
The "find" command in the finder seems not working or I have a problem with the syntax.
In an other hand, I dont find any way to script Spotlight...
I hope I am wrong
Any idea will be welcome
JPaulHi Jeanpauld,
It works fine.
As the final use is in a FileMaker pro data base, I
prefer this solution.
Glad to hear the script worked for your particular situation.
In which dictionnary can I find SpotlightSearch ?
"SpotlightSearch" is just what I named the subroutine of the script. You could name it whatever you like but I figured that would be a good name for it since it uses the spotlight technology to perform the search.
As Joseph Briggs pointed out the best way to get information about the mdfind command used in the do shell script portion of the SpotlightSearch subroutine is to use the Terminal application. Launch the Terminal and type man mdfind.
If you have any further questions regarding this command please feel free to ask and I would be glad to try and help you through it. There's quite a bit that can be done using the mdfind command!
Thanks a lot for your help !
Anytime Jeanpauld.
Sorry about not replying to your response sooner but the new discussion forum format is refusing to email me letting me know when my subscriptions get updated. I used to rely on that feature and will have to keep my own eye on my subscriptions for a bit while Apple works out the bugs in the new forums.
Take care Jeanpauld... -
Where can I find "Getting Started with AppleScript"?
I googled it. And it doesn't show any links from Apple. I'm trying to learn AppleScript and the Language guide says to go through the Overview first which in turn recommends going through Getting Started with AppleScript.
I even searched Mac Reference Library but it just doesn't show up!
Any help?
NeeravNo, certainly not. I mean, I don't know any AppleScript, but I can say with certainty that the answer to that question is no.
Objective-C is a programming language that is an extension of the C language. It is the language that is used to develop applications for Mac and iPhone. Other languages like C++ and Java can be used as well, but Objective-C is the language that Apple really intends for you to use for Mac and iPhone development, since it is heavily integrated with the Cocoa framework (for Mac developemt) and Cocoa Touch framework (for iPhone development). You need to know the C language to learn the Objective-C language, and you need to know the Objective-C language to work with the Cocoa or Cocoa Touch frameworks, but AppleScript is a totally separate and different animal from these things. AppleScript is a scripting language, and although it can technically be used to create applications from what I understand, it is mainly used as a mechanism for controlling applications. For example, you could use AppleScript to tell a certain application to perform a certain task everyday at a certain time. You can use it to create automated workflows and whatnot. I think that's what it's mainly meant for.
It's worth noting, however, taht there is a development environment called AppleScriptObjC. I don't really know anything about this, except that it allows for AppleScript to be used as the primary programming language.
I found a lot of this information at [Wikipedia's AppleScript page|http://en.wikipedia.org/wiki/AppleScript], so you might want to consider looking over it real quick -- it might be helpful. Here is the link to [Wikipedia's Objective-C page|http://en.wikipedia.org/wiki/Objective-c] and [Wikipedia's Cocoa page|http://en.wikipedia.org/wiki/Cocoa_%28API%29]. As someone said on these forums, Wikipedia is far from the last word on any subject, but those links might be helpful for you for just getting an idea of what these things are all about.
Hope that helps some. Please let us know if you have any other questions. -
Mail Message list sort order for Applescript in ML
Hi All,
I recently upgraded from SL to ML. I'm having a few issues with an applescript i use to flag/unflag emails for later handling.
Basically, the script does the following:
- get the message list from one of the inboxes/smartboxes. These are ordered by time and grouped by thread.
- compare one message with the next one
- if some criterias are equal (thread ID, subject, ...) then the second email is unflagged
- repeat until end of list.
It was working fine in SL, as a result, i only had the first email of threads with a flag, so the others could be forgotten.
In ML, it looks like even though the emails are displayed in a specific order (date/thread), using
messages of first message viewer
does not fetch the messages in the same order, so matching cannot happen.
Is this the expected behavior in ML ? Is there anyway to have the list of messaged sorted as displayed ?
Thanks
jmI found a workaround, though there must be something neater.
I added this before my script
tell application "System Events"
tell process "Mail"
tell menu bar 1
tell menu bar item "View"
tell menu "View"
tell menu item "Sort By"
tell menu "Sort By"
click menu item "Subject"
end tell
end tell
end tell
end tell
end tell
end tell
end tell
then the same except "Date" instead of "Subject".
My script does what i want now. -
Shutdown with AppleScript in Lion stop working fine
Hello to everyone,
I have to run this AppleScript (saved as Application.app)
do shell script "sudo shutdown -r now"
With Snow Leopard this script works fine, but now Lion save the application state before shutting down the system, so this application (that is running while the system i shutting down) is automatically restarted at startup.
I also tried to modify it in:
do shell script "sudo shutdown -r +1 &"
tell application "Application"
quit
end tell
but if I quit the script (Application.app) the shutdown command is stopped.
Can anyone help me in solving this problem, please? I don't know how to do.. Is there a shutdown parameter (via command line) for telling the system to not save the application state?
Thanks very much!
I hope to find an "illuminated" programmer that can help me..
AndreaHi "twtwtw" and thanks for you interesting in my problem.. sorry for my bad english; well.. 'illuminated' is not the world I want
I also does not have correctly explained my problem, sorry.. I'll try to do it better.
I use ChronoSync to sync some folder between my iMac (where it's installed on) and my MacBook Pro.. after the syncronization I have to possibility to run an application; the application is the following applescript (saved as .app):
set isConnected to false
try
set reply to do shell script "ping -c 3 -q MacBook-Pro.local | grep received"
if reply contains "received" then
set theCount to (item 4 of (every word of reply)) as integer
if theCount > 0 then set isConnected to true
end if
end try
if isConnected then
do shell script "ssh [email protected] 'sudo shutdown -h now'"
end if
delay 60
do shell script "sudo shutdown -r now"
This script test if my MacBook Pro is available on my network and (if yes) shutdown it.
Then wait 60 seconds and shutdown the iMac. I need to use the "do shell script" because my iMac is in the logon screen when the application/script run.. so the script 'tell application "app" to quit' does not work.
Then.. the application that I have to quit is the same application tha run the shutdown command, so I can't quit it before running the shutdown.
My goal is to build a script that could shutdown my local system (even if it runs while my user account is locked and I see on the monitor the logon screen) and that will not restart automatically after the reboot (caused by the application state saved by Lion).
I hope to have explained better my problem
Sorry again for my english.. and thanks for every suggestion that you could tell me!
Andrea -
Report to find Sales orders with shipping type
Hi SD Gurues
Im looking for a report that i can use to search out SO with a sertain Shipping type.
Our customer center would like to search out all orders going out by SHIP for the next 2 weeks, but there is not an option for this in VL10.
I wa swondering if there is a standard SAP report that have Shipping type as a selcetion creteria.
Hope somone can maybe push me in the right direction.
If there is no standard SAp report for this we will have to use SQ01 or code it our selves.
Kind regards
Jens OlsenDear Jens Olsen,
Go to SE16N give below tables which are relevant for shipping,
VTTK Shipment header
VTTP Shipment item
VTTS Stage in transport
VTSP Stage in transport per shipment item
VTPA Shipment partners
check and revert
regards
Ram -
Icon View in Finder sort order is reversed
Hi,
In Finder, when using icon view, the "arrange by">"date modified" order has reversed. I can't find any settings to change it back.
Other views such as list view are working normally. The change happened yesterday evening and appears to affect all folders. Rebooting makes no difference.
Please can anyone tell me how to correct this?
ThanksHello and Welcome to Apple Discussions...
Try deleting this file.
com.apple.Finder.plist
~/Library/Preferences.
Move that file to the Trash and restart your Mac.
Carolyn -
Cannot access Adobe website with Safari under Lion
Hi guys,
I have 5 macs at home and upgraded two of them with Lion. Since then, these two computers (MBP 17" + imac 27") can no longer access Adobe website (the other three macs + my ipad 2 can still access Adobe website without any problem).
Message errors I get: "Safari cannot connect to server" or in some other cases I get a grey screen with "RSL Error 1 of 1, Error #2048".
This occurs only on Adobe website regardless:
- The web browsers I use (Safari, Firefox, Opera)
- Enabling cookies or not
- Switching on/off my firewall (Little Snitch)
- Reseting Safari cache, history, etc.
I also tried to reboot in safe mode but it still did not work.
I uninstalled Flash player and reinstalled it. Same problem occured.
I updated all my softs to latest versions.
I need to access Adobe website since I am about to purchase online CS5 but so far I just can't.
Anyone has a clue to what's going on?
Should I reinstall Lion?
In advance thanks for your help.
Cheers,
ChristopheTry again. Adobe announced a four-hour maintenance shutdown yesterday and most likely you got caught up in it.
-
Sort order with filtered topics
When looking at all topics in a forum, the topics are listed by the date of the latest post. This makes a certain amount of sense.
Yet when I filter the display to only show me Open Questions, the display isn't sorted by date. I'm not sure what sort criteria is used, but it's not date. I'll see something posted the 6th, then the 5th, then the 4th, then the 5th again...
Is there a way to sort threads when looking at the filtered display?
DocThe problem still exists and there is no workaround. Just because there is a promise of an eventual fix does not mean the question has been answered. To answer the question, there must be either a reasonable workaround, or a permanent fix to the problem.
Maybe you are looking for
-
Can I use Photoshop Touch on GoClever TAB T76GPSTV 7"
I want to buy a Adobe Photoshop Touch for my tablet GoClever TAB T76GPSTV 7" . Will it work? Please help!
-
URGENT: PXI-1033 and DAQmx problem
I bought new laptop with Express Card slot Dell Inspiron 6400. I have PXI-1033 with integrated MXI bridge, Express Card 8360 and PXI-modules: PXI-6251, 6115, 5114 and 4071. I installed drivers 8.3 and plugged in PXI modules into PXI-1033. I first pow
-
From time to time my iPod Touch will sync with my iTunes, but none of my songs or my videos appear on my iPod. All the data is there as it says 24GB (or whatever it is) available, and then it takes a few syncs for the music to show up again. Does any
-
I burned photos to a cd and it included all the faces and low res duplicates
I burned photos to a cd from iphoto and it included the ind. faces and low res. images that iphoto created - I only want the originals.
-
l am using Iphone 4, l still did not receive update to version 8.02 and when l receive or call somebody the person in the other end can't hear me while sometimes its working perfectly normal. Help guyz any ideas